

/* global rules classes */
.special {
    color: var(--inv-clr);
    text-shadow: 0 0 4px var(--inv-clr);
    font-family: "Aref Ruqaa Ink", serif;
    filter: invert(1);
}
.special::selection {
    background-color: var(--slctBg-inv-clr);
}
.err {
    background-color: var(--err-clr) !important;
}
.success {
    background-color: var(--success-clr) !important;
}
/* end global rules classes */
:root {
    --main-clr: hsl(185, 80%, 35%);
    --main-hvr-clr: hsl(185, 73%, 33%);
    --slctBg-clr: #666;
    --slctBg-inv-clr: #999;
    --main-gr-clr: hsl(185, 60%, 25%);
    --inv-clr: #d22e1f;
    --txt-clr: #e6e6e6;
    --bg1-clr: #1b1b1b;
    --imgbg-clr: #141414;
    --bgb-clr: #2a2a2a;
    --bg2-clr: #333;
    --success-clr: hsl(155, 80%, 35%);
    --err-clr: hsl(352.5, 80%, 35%);
    /* not colors */
    --responseBox-entrance-dur: 200ms;
    --watermark-opacity: 0.15;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    border: none;
    outline: none;
    color: inherit;
    -webkit-tap-highlight-color: #fff0;
}
*::selection {
    background-color: var(--main-hvr-clr);
}
html,
body {
    height: 100%;
}
body {
    font-family: "Noto Naskh Arabic", serif;
    background-image: url(../imgs/bg.jpg);
    background-color: var(--bg1-clr);
    color: var(--txt-clr);
    padding-bottom: 3px;
    padding-inline: 5%;
    overflow-y: hidden;
    position: relative;
    background-position-x: 36px;
}
body::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    z-index: -1;
    opacity: 0.97;
    width: 200%;
    height: 200%;
    background-color: var(--imgbg-clr);
}
.wrapper {
        direction: rtl;

    height: 100%;
    max-height: 100%;
    max-width: 80ch;
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    gap: 1px;
    animation: fadeIn 500ms forwards;
    filter: blur(20px);
}
.interactor {
    /*every thing above the response box*/
    width: 100%;
    text-align: center;
    transform: translateY(calc(50vh - 74%));
    transition: transform var(--responseBox-entrance-dur);
}
h1 {
    font-weight: 400;
    font-size: 5rem;
    margin-top: 5px;
    margin-bottom: 18px;
    user-select: none;
    @media (max-height: 700px) {
        font-size: 4.5rem;
    }
}
p.warn {
    font-size: 0.8rem;
}
.text-input {
    width: 100%;
    background-color: var(--bgb-clr);
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 10px;
    margin-top: 2px;
    font-size: 1.1rem;
    transition: background-color 200ms, filter 250ms;
    &.disabled {
        filter: brightness(0.92);
    }
    &:focus {
        background-color: var(--bg2-clr);
    }
}
.action-bar {
    --disapear-duration: 250ms;
    display: flex;
    justify-content: flex-end; /* to make the pushing the copy btn in smoother */
    width: 100%;
    gap: 5px;
    transition: gap var(--disapear-duration);
    &.uncopiable {
        gap: 0;
    }
    &.uncopiable .send-btn {
        flex-basis: 100%;
    }
    &.uncopiable .copy-btn {
        flex-basis: 0%;
        width: 0px;
        padding-inline: 0;
        overflow: hidden;
    }
    & .send-btn {
        letter-spacing: 1.31px;
        font: inherit;
        flex-basis: 85%;
        transition: flex-basis var(--disapear-duration);
        background-color: #00000000;
        position: relative;
        transition-property: filter, font-size;
        transition-duration: 250ms;
        border-radius: 5px;
        &.loading {
            pointer-events: none;
            user-select: none;
            filter: saturate(0.8);
            font-size: 0px;
            & > .helper::before {
                opacity: 1;
            }
            & > .helper::after {
                opacity: 0;
            }
        }
    }
    & .copy-btn {
        flex-basis: 15%;
        transition-property: flex-basis, padding, background-color;
        transition-duration: var(--disapear-duration);
        /* transition: background-color 250ms; */
        &:hover {
            background-color: var(--main-hvr-clr);
        }
    }
}
.btn {
    font-size: 1.35rem;
    font-weight: 900;
    width: 100%;
    padding: 7px;
    background-color: var(--main-clr);
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    user-select: none;
    display: flex;
    justify-content: center;
    align-items: center;
}
.watermark {
    position: absolute;
    top: 40%;
    width: 100%;
    text-align: center;
    pointer-events: none;
    user-select: none;
    z-index: 1;
    opacity: 0; /* hidden to be shown when there is a response*/
    transition: opacity var(--responseBox-entrance-dur);
    & > h2 {
        font-size: 64px;
    }
    & > p {
        width: 100%;
        text-align: center;
    }
}
.response-box {
    --response-bg: var(--bgb-clr);
    width: 100%;
    margin-block: 10px;
    padding: 15px;
    background-color: var(--response-bg);
    border-radius: 5px;
    font-family: "Noto Naskh Arabic", serif;
    line-height: 1.3;
    font-size: 1.25;
    overflow-y: auto;
    opacity: 0;
    height: 0;
    pointer-events: none;
    transition-property: opacity, height, transform;
    transition-duration: var(--responseBox-entrance-dur);
    transform: translateY(200px);
    &.visible {
        opacity: 1;
        pointer-events: auto;
        height: fit-content;
        transform: translateY(0);
    }
    &::-webkit-scrollbar {
        width: 5px;
        height: 5px;
    }
    &::-webkit-scrollbar-track,
    &::-webkit-scrollbar-corner {
        border-top-left-radius: 5px;
        border-bottom-left-radius: 5px;
        background-color: var(--response-bg);
    }
    &::-webkit-scrollbar-thumb {
        border-radius: 5px;
        background: var(--main-clr);
    }
    &::-webkit-scrollbar-thumb:hover {
        background: var(--main-hvr-clr);
    }
    & > p {
        z-index: 2;
    }
    & > p:not(:last-of-type) {
        margin-bottom: 10px;
    }
    --word-clr: hsl(185, 80%, 55%);
    & .word {
        color: var(--word-clr);
        font-weight: 900;
        font-size: 1.1em;
        margin-left: 3px;
        letter-spacing: 0.8px;
    }
    & .word::selection,
    & > P:first-of-type::selection {
        background-color: var(--slctBg-clr);
    }
    & > p:first-of-type {
        color: var(--word-clr);
        font-weight: 900;
        text-align: center;
        font-size: 1.2rem;
    }
}
footer {
    font: inherit;
    width: max-content;
    max-width: 100%;
    border-top: 1px solid #333;
    margin-top: auto;
    text-align: center;
    padding-top: 1px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    padding-inline: 0.5em;
    font-size: 0.625rem;
    & > p {
        margin-inline: 0.8em;
        & > .red {
            color: rgb(255, 0, 0);
        }
        & > .black {
            color: rgb(0, 0, 0);
        }
    }
    & > .downize {
        transform: translateY(0.475em);
    }
    & .special {
        font-size: 1.2em;
        margin-inline: 2px;
    }
}
/* ##Animations## */
/*#Fading content IN while loading __ used in .wrapper#*/
@keyframes fadeIn {
    to {
        opacity: 1;
        filter: blur(0);
    }
}
/* #giving space for the response# */
.wrapper.response-exists {
    & .watermark {
        opacity: var(--watermark-opacity);
    }
    & .interactor {
        transform: translateY(0);
    }
}
/* #amazing button# */
/* glowing effect */
.send-btn > .helper {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 2;
    border-radius: 5px;
}
.helper::before {
    content: "";
    background: linear-gradient(
        45deg,
        var(--main-clr),
        var(--main-gr-clr),
        var(--main-clr),
        var(--main-gr-clr),
        var(--main-clr),
        var(--main-gr-clr),
        var(--main-clr),
        var(--main-gr-clr),
        var(--main-clr)
    );
    position: absolute;
    top: -2px;
    left: -2px;
    background-size: 400%;
    z-index: -1;
    filter: blur(5px);
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    animation: glowing 30s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    border-radius: 5px;
}
.helper::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--main-clr);
    z-index: -1;
    border-radius: 5px;
}
.send-btn:hover > .helper::before {
    opacity: 1;
}
@keyframes glowing {
    0% {
        background-position: 0 0;
    }
    50% {
        background-position: 400% 0;
    }
    100% {
        background-position: 0 0;
    }
}
/* bubbling effect */
.send-btn:before,
.send-btn:after {
    position: absolute;
    content: "";
    display: block;
    width: 140%;
    height: 100%;
    left: -20%;
    z-index: 1000;
    transition: all ease-in-out 0.5s;
    background-repeat: no-repeat;
}
.send-btn:before {
    display: none;
    top: -75%;
    background-image: radial-gradient(
            circle,
            var(--main-clr) 20%,
            transparent 20%
        ),
        radial-gradient(
            circle,
            transparent 20%,
            var(--main-clr) 20%,
            transparent 30%
        ),
        radial-gradient(circle, var(--main-clr) 20%, transparent 20%),
        radial-gradient(circle, var(--main-clr) 20%, transparent 20%),
        radial-gradient(
            circle,
            transparent 10%,
            var(--main-clr) 15%,
            transparent 20%
        ),
        radial-gradient(circle, var(--main-clr) 20%, transparent 20%),
        radial-gradient(circle, var(--main-clr) 20%, transparent 20%),
        radial-gradient(circle, var(--main-clr) 20%, transparent 20%),
        radial-gradient(circle, var(--main-clr) 20%, transparent 20%);
    background-size: 10% 10%, 20% 20%, 15% 15%, 20% 20%, 18% 18%, 10% 10%,
        15% 15%, 10% 10%, 18% 18%;
}
.send-btn:after {
    display: none;
    bottom: -75%;
    background-image: radial-gradient(
            circle,
            var(--main-clr) 20%,
            transparent 20%
        ),
        radial-gradient(circle, var(--main-clr) 20%, transparent 20%),
        radial-gradient(
            circle,
            transparent 10%,
            var(--main-clr) 15%,
            transparent 20%
        ),
        radial-gradient(circle, var(--main-clr) 20%, transparent 20%),
        radial-gradient(circle, var(--main-clr) 20%, transparent 20%),
        radial-gradient(circle, var(--main-clr) 20%, transparent 20%),
        radial-gradient(circle, var(--main-clr) 20%, transparent 20%);
    background-size: 15% 15%, 20% 20%, 18% 18%, 20% 20%, 15% 15%, 10% 10%,
        20% 20%;
}
.send-btn.animate:before {
    display: block;
    animation: topBubbles ease-in-out 0.75s forwards;
}
.send-btn.animate:after {
    display: block;
    animation: bottomBubbles ease-in-out 0.75s forwards;
}
@keyframes topBubbles {
    0% {
        background-position: 5% 90%, 10% 90%, 10% 90%, 15% 90%, 25% 90%, 25% 90%,
            40% 90%, 55% 90%, 70% 90%;
    }
    50% {
        background-position: 0% 80%, 0% 20%, 10% 40%, 20% 0%, 30% 30%, 22% 50%,
            50% 50%, 65% 20%, 90% 30%;
    }
    100% {
        background-position: 0% 70%, 0% 10%, 10% 30%, 20% -10%, 30% 20%, 22% 40%,
            50% 40%, 65% 10%, 90% 20%;
        background-size: 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%;
    }
}
@keyframes bottomBubbles {
    0% {
        background-position: 10% -10%, 30% 10%, 55% -10%, 70% -10%, 85% -10%,
            70% -10%, 70% 0%;
    }
    50% {
        background-position: 0% 80%, 20% 80%, 45% 60%, 60% 100%, 75% 70%,
            95% 60%, 105% 0%;
    }
    100% {
        background-position: 0% 90%, 20% 90%, 45% 70%, 60% 110%, 75% 80%,
            95% 70%, 110% 10%;
        background-size: 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%;
    }
}

/* Help button styles */

/* Help button styles */
.help-container {
    position: absolute;
    top: 1%;
    right: 0%;
    display: flex;
    z-index: 1000;
}
.help-box.invisible {
    display: none; /* Hides the element from view */
    position: flex; /* Position relative to the nearest positioned ancestor */
    z-index: -1000; /* Ensure it is below other elements */
}

/* Show the help-box */
.help-box.visible {
    display: block; /* Shows the element */
    position: flex; /* Or relative, depending on layout */
    z-index: 1000; /* Ensure it is above other elements */

}





/* Help Button Design */
.help-btn {
    background-color: var(--main-clr); /* Using the main color */
    color: var(--txt-clr);
    border-radius: 50%;
    width: 30px; /* Smaller size */
    height: 30px;
    font-size: 1rem;
    position: fixed;
    top: 20px; /* Positioned at the top */
    right: 20px; /* Positioned on the right */
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    z-index: 1000; /* Ensures it's above other elements */
    transform-origin: center; /* Scaling around the center */
    animation: pulse 2s infinite; /* Pulsing animation */
}

.help-btn:hover {
    background-color: var(--main-hvr-clr); /* Slightly darker on hover */
    transform: scale(1.2) rotate(15deg); /* Scale and slight rotation */
    box-shadow: 0px 6px 8px rgba(0, 0, 0, 0.2); /* Enhanced shadow on hover */
}

.help-btn:active {
    transform: scale(0.95) rotate(-10deg); /* Click effect */
}

/* Help Button Icon Swap */
.help-btn.active::after {
    content: 'X';
    transform: rotate(360deg); /* Rotation on toggle */
    transition: transform 0.3s ease-in-out;
}

.help-btn::after {
    content: '?';
    transition: transform 0.3s ease-in-out;
}

/* Pulse animation for the help button */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Help Box Positioning and Animation */
.help-box {
    background-color: var(--bg2-clr);
    color: var(--txt-clr);
    position: fixed;
    top: 60px; /* Below the button */
    right: 20px;
    max-width: 400px; /* Adjusted width */
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(-20px); /* Start with slight upward displacement */
    transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.3s ease;
    z-index: 999; /* Ensures it's above other elements */
}

.help-box.visible {
    opacity: 1;
    transform: translateY(0); /* Slide into view */
    box-shadow: 0px 6px 10px rgba(0, 0, 0, 0.2); /* Enhanced shadow when visible */
}

/* Help Text Style */
.help-text {
    font-size: 0.9rem;
    margin-right: 10px;
    transition: color 0.3s ease; /* Text color transition */
}


/* Add this CSS to the end of your st.css file */
nav {
    background-color: #1b1b1b;
    padding: 10px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
}

nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}

nav ul li a {
    text-decoration: none;
    color: #333;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

nav ul li a:hover, .special-nav-link {
    color: #fff;
    background-color: #1295a1;
}


/* ============================================= */
/* Responsive Navigation Bar                     */
/* ============================================= */

/* Media query for screens smaller than 680px */
@media (max-width: 680px) {
    nav ul {
        /* Allow navigation items to wrap to the next line */
        flex-wrap: wrap;
        
        /* Adjust the gap for a tighter look on mobile */
        gap: 10px; 
    }

    nav ul li {
        /* Allow individual items to grow if needed */
        flex-grow: 1;
        text-align: center;
    }

    nav ul li a {
        /* Make the link fill the available space */
        display: block;
    }
}
/* ============================================= */
/* Overrides for Blog Pages                      */
/* ============================================= */

/* This class will be applied to the <body> tag on blog pages */
body.blog-page {
    font-family: "Noto Naskh Arabic", serif;
    background-color: #141414 !important;
    color: var(--txt-clr) !important;
    padding-bottom: 3px !important;
    padding-inline: 5% !important;
    background-image: url(../imgs/bgs.jpg);
    position: relative !important;
    background-position-x: 36px !important;
    overflow-y: auto !important; /* Force scrolling */
}

/* This targets the main wrapper ONLY on blog pages */
body.blog-page .wrapper {
        direction: rtl;

    height: auto !important; /* Force wrapper to expand with content */
}
