* {
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    padding: 20px 5%;
    margin: auto;
    /* background-image: linear-gradient(120deg, #fdfbfb 0%, #ebedee 100%); */
    color: #222;
    padding-bottom: 200px;
    direction: rtl;
}

#motto {
    margin-top: -10px;
    background: white;
    padding: 20px;
    position: relative;
    z-index: 1000;
}

#searchInput {
    width: 25%;
    height: 40px;

    &::placeholder {
        font-family: 'Vazirmatn', sans-serif;
    }
}

#motto+img {
    box-shadow: 0 0 20px 50px white;
}

.code-wrapper {
    background: #1e1e1e;
    border-radius: 8px;
    margin-top: 1rem;
    overflow: hidden;
}

.code-label {
    background: #333;
    color: #fff;
    font-family: "Vazirmatn";
    padding: 0.5rem 1rem;
    cursor: pointer;
    user-select: none;
}




header {
    width: 100%;
    text-align: center;
    margin-bottom: 40px;
}

header img {
    width: 220px;
    height: auto;
    margin-bottom: 15px;
    border-radius: 3px;
}

header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #1b7c9f;
    text-shadow: 1px 1px 5px gray;
}

/* .w-chat {
    background: #00195a;
    width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 100;
} */

.chat-box {
    height: 100px;
    /* margin: auto; */
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(6px);
    padding: 10px;

    /* >textarea {
        font-family: 'Vazirmatn', sans-serif;
        font-size: 16px;
        padding: 12px;
        border: 1px solid #cfd9e0;
        border-radius: 10px;
        background-color: #ebebeb;
        resize: none;
        width: 71%;
        height: 40px;
    } */
    /* >textarea#question {
        background: none;
        border: none;
        width: 100%;
        height: 100%;
        resize: none;
        box-sizing: border-box;
        font: inherit;
    } */

    >button {
        font-family: 'Vazirmatn', sans-serif;
        padding: 8px 20px;
        /* background: #23a87a;
        background: linear-gradient(90deg, rgb(39, 158, 134) 0%, rgb(44, 44, 44) 100%); */
        /* color: white; */
        border-radius: 8px;
        font-size: 16px;
        font-weight: bold;
        cursor: pointer;
        transition: background 0.3s;
        font-size: 16px;
        color: white;
        /* border: 1px solid white; */
        cursor: pointer;
        display: block;
        /* width: 20%;
        height: 50px; */
    }

}

#loading {
    width: 23%;
    height: 50px;
    background-image: url('load.gif');
    background-size: cover;
    background-position: center;
    display: none;
    border-radius: 5px;
}

textarea::placeholder {
    font-family: 'Vazirmatn', sans-serif;

}



button:disabled {
    background: #9fb3dd;
    cursor: not-allowed;
}

/* button:hover:not(:disabled) {
    background: #1e3a8a;
} */

p:empty {
    display: none;
}

#response {
    width: 75%;
    margin-top: 2rem;
    min-height: 70vh;
    /* background: #f5f3f2;
    opacity: .8;
    padding: 20px;
    border-radius: 10px;
    overflow-x: auto;
    direction: rtl;
    white-space: pre-wrap;
    margin-bottom: 250px;
    background-image: url(parnian.webp);
    background-size: 30%;
    background-position: top center;
    background-repeat: no-repeat; */

    >div {
        padding: 15px;

    }

    >div:nth-of-type(odd) {
        background: white;
    }

    >div:nth-of-type(even) {
        background: #00195a1f;
        margin: 20px 0;
    }
}

#response span>br:only-of-type {
    display: none;
}

pre {
    background: #1e1e1e;
    color: #fff;
    padding: 14px;
    margin: 0;
    border-radius: 0 0 10px 10px;
    direction: ltr;
    position: relative;
    font-family: "DM Mono", monospace;
    position: relative;
    text-align: left;

    span {
        font-family: "DM Mono", monospace;
    }

    code {
        font-family: "DM Mono", monospace;

    }

    &::before {
        content: 'مدرسه فرانت اند پرنیان';
        background: #dfdfdf;
        padding: 10px;
        position: absolute;
        left: 9px;
        top: -39px;
        color: black;
        font-size: 12px;
        font-family: 'Vazirmatn', sans-serif;
        border-radius: 15px 15px 0 0;
    }
}


#retry-btn {
    display: inline-block;
    margin-top: 20px;
    background: #f39c12;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
}

#response h1,
#response h2,
#response h3 {
    font-size: 16px;
}

#response h1::before {
    content: "💡 ";
}

#response h2::before {
    content: "📌 ";
}

#response h3::before {
    content: "📎 ";
}

#response ul {
    padding-right: 20px;
    list-style: none;
}

#response ul li::before {
    content: "✅ ";
    margin-left: 5px;
    color: green;
}

#stateFix {
    /* position: fixed;
    right: 10%;
    bottom: 5%; */
    /* background: #2d2d2d; */
    color: white;
    padding: 10px;
    /* border: 1px solid #ccc; */
    /* border-radius: 3px; */
    font-size: 12px;
    line-height: 2;
    /* z-index: 10050650; */
}

#main {
    /* width: 100%;
    display: flex; */
    /*flex-wrap:wrap;*/
    position: relative;

    >a {
        font-size: 14px;
        position: absolute;
        left: 0;
        top: -15px;
        text-decoration: none;
        color: white;
        z-index: 999;
        border-left: 1px solid black;
        padding: 0 3px;

        &:hover {
            background: #00195a;
            color: white;
        }
    }
}

#sidebar {
    /* padding-top: 10px; */
    /* height: 80vh; */
    /* overflow-y: scroll; */
    /* padding: 20px; */
    /* background: white; */
    /* position: relative; */

    >span {
        display: none;
    }
}

.recent-question {
    width: 100% !important;
    height: 16px !important;
    overflow: hidden;
    font-size: 13px;
}

/*modal///*/
#welcome-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    font-family: 'Vazirmatn', sans-serif;

}

.welcome-backdrop {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
}

.welcome-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* background: white; */
    padding: 30px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    font-family: sans-serif;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    font-family: 'Vazirmatn', sans-serif;
    z-index: 99999;
}

.welcome-content h2 {
    margin-bottom: 10px;
    font-family: 'Vazirmatn', sans-serif;

}

.welcome-content ul {
    list-style: none;
    padding: 0;
    text-align: right;
}

.welcome-content ul li {
    margin: 10px 0;
    font-size: 14px;
    font-family: 'Vazirmatn', sans-serif;
}

#welcome-modal button {
    margin-top: 20px;
    background: linear-gradient(90deg, rgba(27, 169, 141, 0.934) 0%, rgb(17, 96, 133) 100%);
    color: white;
    border: none;
    padding: 10px 25px;
    font-size: 14px;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Vazirmatn', sans-serif;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;

}

#speak {
    width: fit-content;
    margin-top: 20px;
    padding: 15px;
    border-radius: 50px;
    display: flex;
    height: 50px;
    align-items: center;
    background: linear-gradient(90deg, rgba(27, 169, 141, 0.934) 0%, rgb(17, 96, 133)50%, rgba(44, 44, 44, 0) 100%);
    color: white;
    position: relative;
    top: 100%;
    direction: ltr;
    left: 0;
    cursor: pointer;
    z-index: 999;
    color: white;
    overflow: hidden;
    animation: w 15s linear infinite;
    /* position: absolute; */

    >span {
        display: flex;
        width: 15px;
        position: absolute;
        left: 0;
    }

    >h5 {
        position: absolute;
        width: 300px;
        left: 35px;
    }
}

@keyframes w {

    0%,
    50%,
    100% {
        width: 320px;
    }

    52%,
    98% {
        width: 25px;
    }
}

/*responsive///*/
.menu-icon {
    display: none;
    font-size: 28px;
    background: none;
    border: none;
    cursor: pointer;
    margin: 10px;
    color: white;
}

/* حالت موبایل */
@media (max-width: 768px) {
    #sidebar {
        position: fixed;
        top: 10px;
        right: -400px;
        width: 50% !important;
        height: 100%;
        z-index: 1000;
        transition: right 0.3s ease-in-out;
        border: 1px solid rgb(26, 163, 154);
        backdrop-filter: blur(20px);


        >span {
            display: block !important;
            position: absolute;
            left: 20px;
            top: 5px;

            cursor: pointer;

        }
    }

    #stateFix {
        display: none;
    }

    #sidebar.open {
        right: 10px;
    }

    .menu-icon {
        display: inline-block;
    }

    #searchInput {
        width: 100%;
    }

    #response {
        background-size: 85% !important;
    }

    .chat-box {
        /* width: 95% !important; */
        padding: 0 !important;
    }
}



#sidebar-tabs {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0 0 10px 0;
    background: #eee;
    border-radius: 8px;
    overflow: hidden;
}

#sidebar-tabs .tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    font-weight: bold;
    border-left: 1px solid #ccc;
}

#sidebar-tabs .tab:first-child {
    border-left: none;
}

#sidebar-tabs .tab.active {
    background: #ddd;
    color: #000;
}

.sidebar-content {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-content li,
.recent-question {
    padding: 8px 10px;
    border-bottom: 1px solid #ccc;
    font-size: 14px;
    cursor: pointer;
}

/*//////////////pop up////////////*/
.btn {
    color: white;
    padding: 2px 4px;
    margin-top: 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    background: linear-gradient(90deg, rgba(27, 169, 141, 0.934) 0%, rgb(17, 96, 133) 100%);
    transform: translateY(-2px);

}

.btn:hover {
    /* background-color: #00195a; */
    background: none;
    color: white;
    border: 1px solid rgb(26, 163, 154);
    color: rgba(26, 163, 154);

}

/* استایل پاپ‌آپ */
.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* background-color: #fff; */
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    animation: fadeIn 0.3s;
}

.close-btn {
    position: absolute;
    top: 0px;
    right: 20px;
    font-size: 24px;
    font-weight: bold;
    color: #aaaaaa;
    cursor: pointer;
    transition: color 0.3s;
}

.close-btn:hover {
    color: rgb(26, 163, 154);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}