/* --- Premium Glass Auth Modal --- */


.chat-item {
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-item.active {
    background-color: var(--pill-bg); /* highlight color */
    font-weight: bold;
}


.skeleton {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    width: 100%;
    position: relative;
    overflow: hidden;
    margin-bottom: 16px;
}

/* Shine animation */
.skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150px;
    width: 150px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgb(255 255 255 / 16%), transparent);
    animation: shine 1.2s infinite;
}

@keyframes shine {
    0% { left: -150px; }
    100% { left: 100%; }
}

/* Skeleton parts */
.skeleton-header {
    height: 20px;
    width: 120px;
    background-color: #e0e0e0;
    border-radius: 8px;
    margin-bottom: 12px;
}

.skeleton-body {
    height: 120px;
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 8px;
    margin-bottom: 12px;
}
[data-theme="dark"] .skeleton-header{
    background-color: #353940;
}
[data-theme="dark"] .skeleton-body{
    background-color: #353940;
}
[data-theme="dark"] .skeleton-header{
    background-color: #353940;
}
[data-theme="dark"] .skeleton-button::before{
    background-color: #353940;
}

.skeleton-button {
    display: flex;
    justify-content: flex-end; /* right align content */
    height: 32px;
    margin-top: 12px;
}

.skeleton-button::before {
    content: '';
    display: block;
    width: 80px;          /* button ka size */
    height: 100%;
    background-color: #e0e0e0;
    border-radius: 8px;
}

.skeleton .dq-h-1,
.skeleton .dq-h-2,
.skeleton .dq-h-3,
.skeleton .dq-h-1 span:nth-child(2),
.skeleton .dq-h-3 span:nth-child(2),
.skeleton .mushkat-box-1,
.skeleton .h-detail-h,
.skeleton .h-detail-box,
.skeleton .meta-tag
{
    background: #e0e0e0;
    border: 2px solid #e0e0e0;

}
[data-theme="dark"] .skeleton .dq-h-1,
[data-theme="dark"] .skeleton .dq-h-2,
[data-theme="dark"] .skeleton .dq-h-3,
[data-theme="dark"] .skeleton .dq-h-1 span:nth-child(2),
[data-theme="dark"] .skeleton .dq-h-3 span:nth-child(2),
[data-theme="dark"] .skeleton .mushkat-box-1,
[data-theme="dark"] .skeleton .h-detail-h,
[data-theme="dark"] .skeleton .h-detail-box,
[data-theme="dark"] .skeleton .meta-tag
{
    background: #353940;
    border: 2px solid #353940;

}

[data-theme="dark"] .skeleton .h-detail-h{
    background: #353940;

}


.history-item-row {
    display: flex;
    justify-content: unset;
    padding: 0;
    border-radius: 8px;
    cursor: pointer;
}

.history-text {
    max-width: 210px;      /* 👉 yahan apni sidebar width ke hisaab se set karo */
    white-space: nowrap;  /* ek line me rakhe */
    overflow: hidden;     /* extra text hide */
    text-overflow: ellipsis; /* ... show kare */
    cursor: pointer;
    padding: 9px;
}

.history-item-row.new-chat {
    opacity: 0;
    transform: translateX(-10px);
    background-color: rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    animation: slidePulse 0.45s ease-out forwards;
}

@keyframes slidePulse {
    to {
        opacity: 1;
        transform: translateX(0);
        background-color: transparent;
    }
}

.sign-up-modal .auth-modal-forms {
    max-width: 400px;
    margin: 0 auto;
}
.sign-up-modal .auth-modal-switch-btns {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 24px;
}
.sign-up-modal .auth-modal-switch-btn {
    flex: 1;
    padding: 10px 0;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #6c6c9c;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s;
}
.sign-up-modal .auth-modal-switch-btn.active {
    color: #f9fafc;
    border-bottom: 2px solid #3b3b7a;
    background: #3b3b7a;
    border-radius: 6px 6px 0 0;
}

/* Card Container */
.sign-up-modal .auth-modal-card-container {
    position: relative;
    min-height: 450px;
}

/* Card with Glass Effect */
.sign-up-modal .auth-modal-card {
    background: rgba(249, 250, 252, 0.85); /* light glass */
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-radius: 16px;
    padding: 30px 20px;
    position: absolute;
    top: 0; left: 0; right: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.98);
    transition: all 0.35s ease;
    z-index: 1;
    box-shadow: 0 15px 40px rgba(59, 59, 122, 0.15), 0 5px 15px rgba(0, 0, 0, 0.05);
}
.sign-up-modal .auth-modal-card.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    z-index: 2;
}

/* Modal Content */
.sign-up-modal .modal-content {
    background: #00000000;
    border: none;
    box-shadow: none;
}
.modal-content{
    border-radius: 12px;
    overflow: hidden;
}

/* Close Button */
.sign-up-modal .btn-close {
    filter: invert(0.5);
    opacity: 0.7;
    transition: all 0.3s;
}
.sign-up-modal .btn-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Titles */
.sign-up-modal .auth-title {
    font-size: 1.9rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #3b3b7a;
    text-align: center;
}
.sign-up-modal .title-underline {
    display: block;
    width: 50px;
    height: 3px;
    background-color: #3b3b7a;
    margin: 5px 0 20px;
    border-radius: 2px;
}

/* Inputs */
.sign-up-modal .custom-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    color: var(--text-secondary);
    border: 2px solid #ededed;
    font-size: 1rem;
    margin-bottom: 15px;
    transition: all 0.3s;
    backdrop-filter: blur(6px);
    box-shadow: none !important;
    font-family: sans-serif !important;
}
.sign-up-modal .custom-input::placeholder { color: #6c6c9c; }
.sign-up-modal .custom-input:focus {
    border-color: #3131c969;
    outline: none;
    background: rgba(255, 255, 255, 0.9);
}
.remember-label{
    user-select: none;
    color: var(--text-secondary);
}

/* Primary Button */
.sign-up-modal .btn-primary-custom {
    background: linear-gradient(145deg, #3b3b7a, #5656aa);
    color: #f9fafc;
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    font-family: sans-serif;
}
.sign-up-modal .btn-primary-custom:hover {
}

/* Google Button */
.sign-up-modal .google-btn {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgb(216 216 216 / 85%);
    background: rgba(255,255,255,0.85);
    color: #3b3b7a;
    font-weight: 500;
    transition: all 0.3s;
    text-decoration: none;
    font-family: sans-serif;
}
.sign-up-modal .google-btn:hover {
    background: rgb(238 238 238 / 85%);
}

/* Divider */
.sign-up-modal .or-divider {
    display: flex;
    align-items: center;
    color: #6c6c9c;
    margin: 10px 0;
}
.sign-up-modal .or-divider::before,
.sign-up-modal .or-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #91919121;
}
.sign-up-modal .or-divider span { padding: 0 10px; font-size: 0.85rem; }

/* Switch Link */
.sign-up-modal .switch-link {
    color: #3b3b7a;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}
.sign-up-modal .switch-link:hover { color: #5656aa; text-decoration: underline; }

/* Animations */
.auth-view { display: none; animation: fadeIn 0.35s ease; }
.auth-view.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}


/* Auth Navigation Buttons */
.auth-nav-btn {
    padding: 2px 18px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #007C7C;
}

#view-signup .text-muted, #view-.auth-buttons-group .text-muted {
    color: var(--text-secondary) !important;
    font-size: .790em;
    font-family: sans-serif;
}
.no-account{
    color: var(--text-secondary) !important;
    font-family: sans-serif;
}
.allowed-charr{
    margin-bottom: 12px;
}
#resendEmailBtn, #login-resendEmailBtn{
    white-space: nowrap;
    background: #3b3b7a;
    color: white;
    border: none;
    }

.email-verify-banner {
    /* position: fixed; */
    top: 4rem; /* header ke bilkul neeche */
    left: 0;
    right: 0;
    z-index: 49; /* header se neeche */
    border-radius: 10px;
    color: #1e3a8a;
    background: #ebebeb;
    font-size: 16px;
    text-align: right;
}

.email-verify-banner .banner-inner {
    max-width: 100%;
    margin: auto;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    margin-top: 20px;
    flex-direction: column;
}
[data-theme="dark"] .email-verify-banner{
    background-color: #36383c;
    color: white;
}
.email-verify-banner .banner-inner{
    line-height: 1.9;
    gap: 10px;
}
.email-verify-banner .btn-close {
    position: absolute;
    left: 7px;
}


/* Auth Buttons (Login/Signup) Theme Styles */
.auth-nav-btn {
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 6px;
    padding: 6px;
    border: none;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, border 0.18s;
    margin-left: 6px;
    outline: none;
    box-shadow: none;
}


.auth-buttons-group{
    display: flex;
    gap: 4px;
    padding: 0;
    margin-left: auto
}

.auth-buttons-group button{
    font-size: 15px;
    display: flex;
    align-items: center;
    min-width: 90px;
    justify-content: center;
    gap: 5px;
    color: white;
    transition: 0.3s;
    /* background-color: #252628; */

}

.auth-buttons-group .signup-btn{
    background-color: #3B3B7A;
    border: 2px solid #3B3B7A;
}

.auth-buttons-group .login-btn{
    background-color: #ffffff;
    border: 2px solid #3B3B7A;
    color: #000000;
}

[data-theme="dark"] .auth-buttons-group .login-btn{
    border: 2px solid #ffffff;
}
[data-theme="dark"] .auth-buttons-group .login-btn:hover{
    border: 2px solid #3B3B7A;
}

.auth-buttons-group .login-btn:hover{
    background-color: #2f2f68;
    color:#ffffff;
}

.auth-buttons-group .signup-btn:hover{
    color: #2f2f68;
    background-color:#ffffff;
}

[data-theme="dark"] .auth-buttons-group button:hover{
    background-color: #2f2f68;
    color:#ffffff;
}

html {
    height: 100%;
    width: 100%;
    scroll-behavior: smooth;
}

:root {
    --bg-body: #F9FAFC;
    --bg-sidebar: #ffffff;
    --text-primary: #333333;
    --text-secondary: black;
    --tt-clr: gray;
    --accent-color: #2c2955;
    --border-color: #e5e5e5;
    --pill-bg: #EFF0F2;
    --pill-hover: #e5e7eb;
    --input-bg: #ffffff;
    --filter-active: #252628;
    --active-clr: white;
    --input-bg-edit: #EAEFF5;
    --purp-blk: #3B3B7A;
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 70px;
    /* Slight increase for better icon spacing */
    --transition-speed: 0.3s;
    --active-chip-bg: #e0e0e0;
    --footer-text: #888888;
    --side-btn-clr: #EAEFF5;
    --qh-text: #25292c;
    --qh-main: #e0f5f8;
    --qh-bdr: #b7e1e7;
    --qh-span: #b7e1e7;
    --qh-bdr2: #b7e1e7;
}

[data-theme="dark"] {
    --bg-body: #1f2125;
    --bg-sidebar: #151616;
    --text-primary: #ffffff;
    --text-secondary: #ffffff;
    --accent-color: #d9d9e3;
    --border-color: #4d4d4f3b;
    --pill-bg: #282b30;
    --purp-blk: #4a4d54;
    --input-bg-edit: #1c1d1f;
    --filter-active: #252628;
    --pill-hover: #2A2B32;
    --input-bg: #282b30;
    --active-chip-bg: #2A2B32;
    --footer-text: #9a9a9a;
    --side-btn-clr: #282b30;
    --qh-text: white;
    --qh-main: #209eaf;
    --qh-bdr: #209eaf;
    --qh-span: #006b79;
    --qh-bdr2: #333840;
    /* improved visibility */
}


     font-face {
        font-family: "Mehr Nastaliq Web 3";
        src: url("../fonts/Mehr\ Nastaliq\ Web\ 3.ttf");
        font-display: swap;
    }
    @font-face {
        font-family: "Al-Qalam";
        src: url("../fonts/AlQalamQuranMajeedWeb2_D.otf");
        font-display: swap;
    }
    @font-face {
        font-family: "Aslam";
        src: url("../fonts/Aslam.ttf");
        font-display: swap;
    }

    @font-face {
        font-family: "Bahij";
        src: url("../fonts/Bahij TheSansArabic Bold.ttf");
        font-display: swap;
    }

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: 'Mehr Nastaliq Web 3';
    margin: 0;
    padding: 0;
    display: flex;
    height: 100vh;
    height: 100dvh;
    /* Fallback for older browsers */
    min-height: 100%;
    overflow: hidden;
    transition: background-color var(--transition-speed);
}

/* ================= Sidebar ================= */
.sidebar-container {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    /* border-left: 1px solid var(--border-color); */
    /* RTL: Border left */
    display: flex;
    flex-direction: column;
    padding: 1rem;
    transition: width var(--transition-speed);
    z-index: 100;
    flex-shrink: 0;
    box-shadow: 0px 0px 16px #8585856b;
    will-change: transform;
}
body[data-theme="dark"] .sidebar-container{
    box-shadow: 0px 0px 16px #2929296b

}

/* Header Row */
.sidebar-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    height: 40px;
}

.sidebar-toggle-btn {
    background: none;
    border: none;
    color: #3B3B7A;
    font-size: 1.2rem;
    cursor: ew-resize !important;
}
[data-theme="dark"] .sidebar-toggle-btn{
    color: white;
}

.sidebar-logo-group {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    white-space: nowrap;
    cursor: ew-resize !important;
}

.sidebar-title {
    margin: 0;
    font-weight: bold;
    color: var(--text-primary);
    font-size: 1.2rem;
}

.ai-icon-logo {
    color: var(--accent-color);
    font-size: 1.2rem;
}

/* Navigation Buttons */
.sidebar-search-row {
    margin-bottom: 1rem;
}

.input-bottom {
    display: flex;
    align-items: center;
    padding: 10px;
    border-top: 1px solid var(--border-color);
}

.sidebar-nav-btn {
    width: 100%;
    max-width: 184px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    background: transparent;
    border: none;
    /* Added border */
    border-radius: 20px;
    /* Pill radius */
    color: var(--text-primary);
    cursor: pointer;
    /* transition: background 0.2s; */
    background-color: var(--side-btn-clr);
    /* Distinct background like input */
}

body[data-theme="dark"] .sidebar-nav-btn svg {
    filter: brightness(0) invert(1);
}

.sidebar-nav-btn:hover {
    background-color: var(--pill-hover);
    /* Darker hover */
}

.btn-text {
    white-space: nowrap;
}

/* History List */
.sidebar-history-area {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 1rem;
    overflow-x: hidden;
}

.sidebar-dropdown {
    background-color: var(--input-bg);
    padding: 10px;
    box-shadow: 0px 0px 6px #0000002b;
    border: none;
    /* position: absolute;
    left: 0 !important;
    transform: unset !important;
    top: 33px !important;
    right: unset !important;
    bottom: unset !important;
    border-color: #dee2e7; */
}
.sidebar-dropdown #sidebar-history-container{
    margin-top: 10px !important;
    margin-bottom: 10px !important;

}
.sidebar-user-row .sidebar-dropdown{
     position: absolute;
    left: 0 !important;
    transform: unset !important;
    top: 33px !important;
    right: unset !important;
    bottom: unset !important;
    border-color: #dee2e7;
}
body[data-theme="dark"] .sidebar-dropdown{
    border-color: #4e4e4e;
}
.sidebar-dropdown a, .sidebar-dropdown button {
    font-size: 12px;
    border: none;
    padding: 10px 6px;
    display: flex;
    border-radius: 8px;
    color: var(--text-secondary);
    width: 100%;
    justify-content: flex-end;
    align-items: center;
    gap: 7px;
    font-family: sans-serif;
}
.sidebar-dropdown a:active{
    background-color: var(--input-bg);
    color: var(--text-secondary);
}
body[data-theme="dark"] .dropdown-item:focus,body[data-theme="dark"] .dropdown-item:hover{
    background-color: #1f2124;
    color: white;
}
body[data-theme="dark"] .sidebar-dropdown a:hover svg{
    filter: brightness(0) invert(1);
}

.sidebar-dropdown li:nth-last-child(1) a {
    border-bottom: none;
}

body[data-theme="dark"] .sidebar-dropdown svg {
    filter: brightness(0) invert(1) !important;
}

body[data-theme="dark"] .sidebar-dropdown a:hover svg {
    filter: unset;
}

.history-label {
    font-size: 18px;
    color: var(--tt-clr);
    margin-bottom: 0.5rem;
    white-space: nowrap;
    padding-top: 10px;
}

.history-item-row {
    display: flex;
    /* Flex to align text and dots */
    align-items: center;
    justify-content: unset;
    padding: 0px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.9rem;
    position: relative;
    margin-bottom: 4px;
}

.history-item-row:hover {
    background-color: var(--pill-bg);
}

.history-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-grow: 1;
}

.history-options {
    /* Always visible dots as requested? Or on hover? Prompt says "show 3 vertical dots in all menu items".
       Usually this implies always visible or visible on hover. Image usually shows on hover or selected.
       I will set them to always visible but subtle, or opacity changes. */
    flex-shrink: 0;
    margin-right: 0;
    padding: 0px 3px;
    border-radius: 5px;

}
#sidebar-history-container .history-options:hover{
    background: #d3d7db;
}
body[data-theme="dark"] #sidebar-history-container .history-options:hover{
    background: #171717;
}

.icon-btn-dots {
    background: none;
    border: none;
    padding: 0;
    color: var(--text-secondary);
    cursor: pointer;
    opacity: 0.7;
    min-height: 22px;
    display: flex;
    align-items: center;
}

.icon-btn-dots:hover {
    opacity: 1;
    color: var(--text-primary);
}

/* User Profile */
.sidebar-user-row {
    /* border-top: 1px solid var(--border-color); */
    padding-top: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-name {
    max-width: 180px;
    font-weight: 600;
    font-family: sans-serif;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.forget-p-t{
    color: rgb(59, 59, 122) !important;
    font-family: sans-serif !important;
    font-weight: 600
;
}

/* ================= Main Content ================= */
.main-content-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background-color: var(--bg-body);
}

/* Header / Theme Toggle */
.main-header {
    padding: 1rem;
    display: flex;
    justify-content: flex-end;
    /* Space between mobile toggle and theme toggle */
    align-items: center;
}

.mobile-toggle-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
    display: none;
}
body .unauth-toggle-btn{
    display: none !important;
}

/* Slider Toggle Switch */
.theme-toggle-slider {
    width: 60px;
    height: 30px;
    background-color: var(--pill-bg);
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
    /* Prevent shrinking */
    flex-shrink: 0;
}

.toggle-track {
    width: 100%;
    justify-content: space-between;
    display: flex;
    align-items: center;
}

.toggle-track svg {
    position: relative;
    z-index: 3;
}

body[data-theme="dark"] .toggle-track svg:nth-child(1) {
    filter: brightness(0) invert(1);
}

.toggle-thumb {
    width: 24px;
    height: 24px;
    background-color: #3B3B7A;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s;
    z-index: 2;
}

[data-theme="dark"] .toggle-thumb {
    transform: translateX(30px);
    /* MOVED RIGHT (Positive) */
    background-color: #151616;
}

.icon-sun,
.icon-moon {
    z-index: 1;
    font-size: 14px;
    color: var(--text-secondary);
}

.icon-sun {
    opacity: 1;
}

.icon-moon {
    opacity: 1;
}


/* Center Layout */
.center-content-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    width: 100%;
}

.main-logo-section {
    text-align: center;
    margin-bottom: 15px;
}

.main-title {
    font-size: 2.5rem;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    justify-content: center;
    color: var(--text-primary);

}
.main-title svg{
    color: #3B3B7A;
}

body[data-theme="dark"] .main-title svg {
    filter: brightness(0) invert(1);
}

body[data-theme="dark"] .sidebar-toggle-btn svg {
    filter: brightness(0) invert(1);
}

body[data-theme="dark"] .user-avatar {
    filter: brightness(0) invert(1);

}

.brand-ai {
    color: var(--accent-color);
    font-weight: 700;
}

.ai-logo {
    width: 50px;
}

.brand-text {
    font-size: 30px;
    font-family: "Bahij";
}

/* Input Card Area */
.input-container-card {
    background-color: var(--input-bg);
    border-radius: 16px;
    width: 100%;
    max-width: 850px;
    box-shadow: 0 7px 6px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    margin-bottom: 1.5rem;
}

.input-row {
    position: relative;
    display: flex;
    align-items: center;
    padding: 10px 0px 0px 0px;
}

.main-search-input {
    width: 100%;
    border: none;
    background: transparent;
    padding: 5px 15px 30px 50px;
    /* Space for arrow button if simple absolute */
    font-size: 1.1rem;
    color: var(--text-primary);
    font-family: initial !important;
    outline: none;
}
.main-search-input::placeholder{
    font-family: 'Mehr Nastaliq Web 3';
}

.chat-results-container.active .main-search-input {
    padding: 5px 15px 5px 50px;
}

.send-btn {
    position: absolute;
    left: 10px;
    /* RTL end */
    background-color: #3B3B7A;
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
}

body[data-theme="dark"] .send-btn {
    background-color: #202123;
}

.send-btn:hover {
    transform: scale(1.05);
}

/* Filter Row (Radio Style) */
.filter-row {
    display: flex;
    gap: 10px;
    padding: 5px;
    flex-wrap: wrap;
    justify-content: center;
    transition: unset;
    /* Centered in input? Prompt said "action buttons showing in the input area" */
    /* Separator */
}

.filter-chip {
    background: transparent;
    border: 1px solid transparent;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    /* transition: all 0.2s; */
}

.sidebar-container.collapsed .sidebar-logo-group {
    display: none !important;
}

body[data-theme="dark"] .sidebar-logo-group svg {
    filter: brightness(0) invert(1);
}

.sidebar-container.collapsed .sidebar-nav-btn {
    border: none;
    background: none;
}

body[data-theme="dark"] .filter-chip svg {
    filter: brightness(0) invert(1);
}

.filter-chip.active svg {
    filter: brightness(0) invert(1);
}

.filter-chip:hover {
    background-color: var(--pill-bg);
}

.filter-chip.active {
    background-color: var(--filter-active);
    color: var(--active-clr);
}

.badge-pill {
    background-color: #333;
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
}

/* Suggestions */
.suggestions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    max-width: 800px;
}

.suggestion-chip {
    background-color: var(--pill-bg);
    border: 1px solid transparent;
    padding: 10px 20px;
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    /* transition: all 0.2s; */
}

.suggestion-chip:hover {
    border-color: var(--border-color);
    color: var(--text-primary);
}


/* Footer */
.main-footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-secondary);
    font-size: 16px;
    margin-top: auto;
}


/* ================= Collapsed State ================= */
.sidebar-container.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-container.collapsed .btn-text,
.sidebar-container.collapsed .sidebar-title,
.sidebar-container.collapsed .history-label,
.sidebar-container.collapsed .history-text,
.sidebar-container.collapsed .user-name {
    display: none;
}

/* Center elements when collapsed */
/* We can align items to center in flex column */
.sidebar-container.collapsed .sidebar-header-row {
    justify-content: center;
}

.sidebar-container.collapsed .sidebar-logo-group {
    display: none;
    /* Hide entire logo group? Prompt said "AI icon ... showing" */
}

/* Wait, prompt said: "collapsed... showing with only AI icon and Search icon" */
/* So we need to ensure AI icon is NOT inside the hidden group effectively? */
/* Layout adjustment for logo: */
/* In HTML I put .sidebar-logo-group { h4, i }. removing .sidebar-logo-group hides both. */
/* Let's be smart. In CSS, I can target children. */

.sidebar-container.collapsed .sidebar-logo-group {
    display: flex;
    /* keep flex */
}

.sidebar-container.collapsed .sidebar-title {
    display: none;
    /* hide text */
}

.sidebar-container.collapsed .sidebar-nav-btn {
    justify-content: center;
}

.sidebar-container.collapsed .history-options {
    display: none;
    /* Hide dots in collapsed state? Or show distinct icons? Standard is hiding history list usually.
                      But prompt didn't strictly say hide history list, just "showing with only AI icon...".
                      Usually history list hides or becomes icons.
                      Let's hide the list content for cleanliness as per "only AI icon and Search icon" instruction. */
}

.sidebar-container.collapsed .sidebar-history-area {
    display: none;
    /* Hide list to match "only AI icon and search icon" request strictly */
}

.sidebar-container.collapsed .sidebar-user-row {
    justify-content: center;
    border-top: none;
}

.sidebar-container.collapsed .sidebar-toggle-btn {
    /* If we center header, toggle button needs to move? */
    /* Usually toggle button stays. */
}


/* Fix for Logo group when collapsed */
/* We want the toggle button AND the AI icon? Or just items? */
/* "sidebar showing with only AI icon and Search icon same like chat gpt" */
/* ChatGPT collapsed:
   Top: Toggle Button | New Chat Icon
   Middle: History hidden
   Bottom: User Icon
*/
/* The user's image shows "AI" logo text. */
/* Let's try to keep Toggle Button + AI Icon (maybe stacked or side-by-side compacted) */

.sidebar-container.collapsed .sidebar-header-row {
    flex-direction: column;
    height: auto;
    gap: 15px;
}

.sidebar-container.collapsed .sidebar-logo-group {
    justify-content: center;
}


/* Helper specific */
.hide-scrollbar::-webkit-scrollbar {
    width: 4px;
}

.hide-scrollbar::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}
.detail-content-text{
    font-size: 21px;
}

.modal-dialog-scrollable .modal-body::-webkit-scrollbar {
    width: 4px;
}

.modal-dialog-scrollable .modal-body::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {

    .sidebar-container,
    .sidebar-container.collapsed {
        position: fixed;
        /* Better than absolute for overlay */
        top: 0;
        right: 0;
        /* RTL anchor */
        height: 100%;
        width: var(--sidebar-width) !important;
        /* Force full width, disable collapsed 70px */
        box-shadow: none;
        z-index: 899;
        transform: translateX(100%);
        /* RTL Hidden (Right side) */
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        backface-visibility: hidden;
        perspective: 1000px;
    }
    .mobile-toggle-btn{
        display: flex;
    }
    .sidebar-container.mobile-open {
        transform: translateX(0);
    }


    .main-header {
        justify-content: space-between;
    }

    /* Force "collapsed" sidebar to look "expanded" on mobile (since we hide it completely instead) */
    .sidebar-container.collapsed .btn-text,
    .sidebar-container.collapsed .sidebar-title,
    .sidebar-container.collapsed .history-label,
    .sidebar-container.collapsed .history-text,
    .sidebar-container.collapsed .user-name,
    .sidebar-container.collapsed .sidebar-history-area,
    .sidebar-container.collapsed .history-options {
        display: block !important;
    }

    .sidebar-container.collapsed .sidebar-nav-btn,
    .sidebar-container.collapsed .sidebar-user-row {
        justify-content: flex-start !important;
    }

    .sidebar-container.collapsed .sidebar-header-row {
        flex-direction: row !important;
        height: 40px !important;
        /* Reset height */
        justify-content: space-between !important;
    }

}
  @media(max-width: 576px) {
        .main-title svg{
            width: 50px ;
            height: 50px;
        }
        .filter-chip {
            padding: 6px 8px;
        }

        .main-search-input {
            padding: 6px 15px 5px 50px;
        }
        .suggestion-chip{
            padding: 5px 20px;
        }
        .brand-text{
            font-size: 24px;
        }
        .dq-madni{
            font-size: 14px;
        }
        .book-card{
            flex-direction: column;
        }
    }

/* ================= Chat Results View ================= */
.chat-results-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    position: relative;
    max-width: 743px;
    margin: 0 auto;
    width: 100%;
    min-height: 0;
}

.chat-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 0;
    min-height: 0;
    /* Footer handles space */
}
.chat-scroll-area {
    overflow-y: auto;
    scrollbar-width: none;      /* Firefox */
    -ms-overflow-style: none;   /* IE / old Edge */
}

.chat-scroll-area::-webkit-scrollbar {
    display: none;              /* Chrome, Safari, Edge */
}

/* User Query Bubble */
.user-query-section {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.query-bubble {
    background-color: var(--input-bg-edit);
    border-radius: 16px;
    width: 100%;
    /* Match input style */
    position: relative;
    color: var(--text-primary);
    font-size: 1.1rem;
    line-height: 1.6;
    padding: 12px;
}

.query-bubble textarea {
    background-color: transparent !important;
    border: none !important;
}

.query-actions {
    position: absolute;
    bottom: -35px;
    /* Hanging below */
    right: 10px;
    /* RTL right? wait, RTL is active */
    /* Check RTL: dir=rtl means right is actually start... no, CSS right is visual right */
    /* In LTR, buttons usually right. In RTL, buttons usually left? */
    /* Let's place them below-left for RTL consistency or follow image */
    /* Image shows icons on bottom right of bubble in RTL layout? */
    left: 10px;
    /* RTL End */
    display: flex;
    gap: 10px;
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.2s;
}

.action-btn:hover {
    color: var(--accent-color);
}

/* Answer Cards */
.answers-grid {
    display: flex;
    flex-direction: column;
    /* Stacked */
    gap: 20px;
    padding-bottom: 20px;
    /* align-items: center; */
}
.answers-grid:nth-last-child(1){
    padding-bottom: 5px !important;
}
/* .chat-mode .chat-share{
    display: block !important;
}
.chat-mode .chat-dropdown{
    display: block !important;
} */
.answer-card {
    background-color: var(--bg-color);
    /* Or white/card bg */
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    width: 100%;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s, box-shadow 0.2s;
}
.answer-card.active{
    box-shadow: 0px 5px 7px #00000026 !important;
    /* border-bottom: 2px solid #3b3b7a; */
    border: 2px solid #3b3b7a;
}
[data-theme="dark"] .answer-card.active{
    /* border-bottom: 2px solid #3c3c3c !important; */
    border: 2px solid #3c3c3c !important;
    box-shadow: 0px 5px 7px #000000b8 !important;
}

.answer-card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.card-header-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    justify-content: flex-start;
    direction: rtl;
    width: fit-content;
    border: 1px solid #EFF0F2;
    padding: 5px 15px;
    border-radius: 1000px;
    /* RTL Header alignment */
}
[data-theme="dark"] .card-header-badge{
    border: 1px solid #eff0f217;
}

.card-body-text {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 15px;
    text-align: justify;
}

.read-main-btn-box {
    display: flex;
    justify-content: flex-end;
}

.read-more-btn {
    background-color: #3B3B7A;
    color: white;
    border: none;
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.2s;
}


.read-more-btn:hover {
    background-color: #23235c;
}

/* Feedback */
.feedback-section {
    text-align: center;
    margin: 5px 0;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 0px 10px 15px 0px;
}

.feedback-text {
    display: block;
}

.feedback-buttons {
    display: flex;
    justify-content: center;
    gap: 5px;
}

.feedback-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    /* Circle */
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.feedback-btn:hover {
    background-color: var(--pill-bg);
    color: var(--text-primary);
}


/* Fixed Footer */
.fixed-chat-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, var(--bg-color) 80%, transparent 100%);
    padding: 20px;
    padding-top: 40px;
    /* Fade gradient space */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    z-index: 100;
}

.load-more-btn {
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 8px 8px 14px;
    border-radius: 1000px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    font-family: inherit;
}

.load-more-btn:hover {
    background-color: var(--pill-bg);
}


.scroll-down-btn {
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 8px 8px 14px;
    border-radius: 1000px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    font-family: inherit;
}

.scroll-down-btn:hover {
    background-color: var(--pill-bg);
}


/* Input Placeholder in Footer */
#footer-input-placeholder {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0px 15px 0px 15px;
    position: relative;
    /* The JS will move the .input-container-card here */
}
.load-icon{
    background: #151616;
    border-radius: 1000px;
    padding: 0px 3px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 28px;
    height: 28px;
    line-height: initial;
}

.load-icon svg{
    color: white;
}

.scoll-icon{
    background: #151616;
    border-radius: 1000px;
    padding: 0px 3px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 28px;
    height: 28px;
    line-height: initial;
}

.scoll-icon svg{
    color: white;
}

.load-more-container{
    position: absolute;
    top: -50px;
    left: 0;
    right: 0;
    margin: auto;
    width: fit-content;
}
.load-more-container i{
    color: white;
}

.scroll-down-container{
    position: absolute;
    top: -50px;
    left: 0;
    right: 0;
    margin: auto;
    width: fit-content;
}
.scroll-down-container i{
    color: white;
}

/* Chat Mode Toggles */
body.chat-mode .main-logo-section,
body.chat-mode .suggestions-grid,
body.chat-mode #home-footer
/* body.chat-mode .theme-toggle-slider  */
{
    display: none !important;
}

body.chat-mode .center-content-wrapper {
    display: none !important;
}

body.chat-mode .chat-results-container {
    display: flex !important;
    border-radius: 15px;
}

/* Input Adjustment in Footer */
body.chat-mode .input-container-card {
    margin-bottom: 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

/* Edit Mode Styles */
.edit-mode-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
}

.edit-textarea {
    width: 100%;
    min-height: 100px;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: inherit;
    resize: none;
    font-size: 1rem;
    line-height: 1.6;
    outline: none;
}

.edit-textarea:focus {
    border-color: var(--accent-color);
}

.edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-save,
.btn-cancel {
    padding: 8px 18px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-save {
    background-color: #3B3B7A;
    /* Fallback/explicit color handling if variable issues, but variable is safe */
    background-color: var(--accent-color);
    color: white;
    border: none;
}

.btn-save:hover {
    opacity: 0.9;
}

.btn-cancel {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-cancel:hover {
    background-color: var(--pill-bg);
}

/* Query Textarea Styles */
.query-textarea {
    width: 100%;
    background: transparent;
    border: 1px solid transparent;
    /* Transparent border to prevent jump on edit */
    color: var(--text-primary);
    font-size: 1.1rem;
    resize: none;
    outline: none;
    overflow: hidden;
    /* Auto-growth JS can handle this or just scroll */
    padding: 0;
    line-height: 1.6;
    margin-bottom: 0px;
}

.query-textarea:disabled {
    background: transparent;
    color: var(--text-primary);
    cursor: default;
    opacity: 1;
    line-height: 1.9;
    /* Fix for some browsers dimming disabled text */
}

/* .query-textarea:not(:disabled) {
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: 8px;
} */

/* Edit Actions Group */
.edit-actions-group {
    display: none;
    justify-content: flex-end;
    gap: 10px;

}

/* Reuse action button styles but specifics */
.btn-icon-round {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-icon-save {
    background-color: #3B3B7A;
    /* Fallback */
    background-color: var(--accent-color);
    color: white;
}

.btn-icon-cancel {
    background-color: var(--bg-body);
    /* border: 1px solid var(--border-color); */
    color: var(--text-secondary);
}

.btn-icon-round:hover {
    transform: scale(1.1);
}

body[data-theme="dark"] .btn-icon-save {
    background-color: #202123;
}

/* Detail Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.modal-container {
    background-color: var(--bg-body);
    width: 90%;
    max-width: 800px;
    height: 80vh;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.modal-header {
    height: 60px;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-body);
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-actions-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-action-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-action-btn:hover {
    background-color: var(--pill-bg);
    color: var(--text-primary);
}

.vertical-divider {
    width: 1px;
    height: 24px;
    background-color: var(--border-color);
    margin: 0 5px;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.8;
}

/* RTL adjustment if needed */
[dir="rtl"] .modal-header {
    flex-direction: row;
    /* Flex works naturally with RTL if not forced */
}


/* ================= Split Pane Layout ================= */

/* Wrapper replaces the old container's top-level role */
#chat-split-wrapper {
    display: none;
    /* hidden by default, shown in chat-mode */
    width: 100%;
    height: 100%;
    padding: 15px;
    overflow: hidden;
    flex-direction: row;
    /* RTL or LTR handled by dir attribute logic usually, but let's be explicit if needed */
}

/* Show wrapper in chat mode */
body.chat-mode #chat-split-wrapper {
    display: flex !important;
}

/* Reset Chat Results Container to work inside wrapper */
#chat-split-wrapper .chat-results-container {
    display: flex;
    /* Always flex inside wrapper */
    flex-direction: column;
    width: 100%;
    /* Default full width */
    height: 100%;
    transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-left: 1px solid transparent;
    /* Separator placeholder */
}

.chat-results-container.active {
    background-color: #EAEFF5 !important;
    padding: 5px 0px 15px 0px !important;
}
.chat-results-container.active #footer-input-placeholder{
    padding: 0px 10px 0px 10px;
}

body[data-theme="dark"] .chat-results-container.active {
    background-color: #202123 !important
}

body[data-theme="dark"] .chat-results-container.active .answer-card {
    background-color: transparent !important;
}

/* body[data-theme="dark"] .detail-title-group svg {
    filter: brightness(0) invert(1) !important;
} */

body[data-theme="dark"] .detail-action-btn svg {
    filter: brightness(0) invert(1) !important;

}

.chat-results-container.active .query-bubble {
    /* background-color: var(--purp-blk) !important; */
    background-color: #dae2eb !important;

}

body[data-theme="dark"]  .chat-results-container.active .query-bubble {
    /* background-color: var(--purp-blk) !important; */
    background-color: #2c2c2c !important;
}

.chat-results-container.active .query-bubble textarea {
    /* color: white !important; */
}

.chat-results-container.active .answer-card {
    background-color: white !important;
}

.chat-results-container.active .send-btn {
    display: flex !important;
}

.chat-results-container.active .send-btn-2 {
    display: none !important;
}

.chat-results-container.active .filter-chip {
    padding: 6px !important;
}
.chat-detail-actions-group{
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 20px;
}



/* Detail Pane Styles */
.detail-pane {
    border-radius: 15px;
    display: none;
    flex: 1;
    /* Takes remaining space */
    flex-direction: column;
    height: 100%;
    background-color: var(--bg-body);
    overflow: hidden;
    /* In LTR: border-left. In RTL: border-right? */
    border: 1px solid var(--border-color);
    margin-right: 15px;
    /* Assuming RTL layout, pane is on Left, Content on Right. Separator on Right of Pane. */
}

/* Split Active State */
#chat-split-wrapper.split-active .chat-results-container {
    width: 30%;
    min-width: 320px;
    max-width: 400px;
    /* Optional cap */
    /* border-right: 1px solid var(--border-color); */
    /* Separator */
}
body[data-theme="dark"] #chat-split-wrapper.split-active .chat-results-container{
    background-color: #1c1d1d !important;
}

#chat-split-wrapper.split-active .chat-results-container .user-query-section,
#chat-split-wrapper.split-active .chat-results-container .feedback-section {
    /* Optional: Hide some elements if too cramped? No, keep them. */
}

#chat-split-wrapper.split-active .detail-pane {
    display: flex;
}

/* Detail Pane Internals (Reuse Modal Styles where applicable) */
.detail-header {
    height: 60px;
    padding: 0 20px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-body);
}

.detail-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.detail-actions-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dynamic-buttons {
    display: flex;         /* buttons in a row */
    flex-wrap: nowrap;     /* don't wrap to next line */
    gap: 8px;              /* spacing between each button */
}

.detail-action-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 5px;
    text-decoration: none;
}
.btn-close-detail{
    border-radius: 1000px;
    display: flex;
    width: 35px;
    height: 35px;
    align-items: center;
    justify-content: center;
}



.detail-action-btn:hover {
    background-color: var(--pill-bg);
    color: var(--text-primary);
}

.detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    color: var(--text-primary);
    font-size: 1.05rem;
    line-height: 1.8;
}
 .detail-body::-webkit-scrollbar {
    width: 5px;
    }
    .detail-body::-webkit-scrollbar-track {
    box-shadow: inset 0 0 0px #5f5d5d;
    background: var(--input-bg);
    }
    .detail-body::-webkit-scrollbar-thumb {
        background: #3B3B7A !important;

    border-radius: 5px;
    }
   body[data-theme="dark"] .detail-body::-webkit-scrollbar-thumb {
    background: #3B3B7A !important;
    border-radius: 5px;

    }

/* RTL Specifics */
/* If body dir="rtl", Flex Row means: First child is Right, Second is Left.
   Structure: 1. Chat (Right), 2. Detail (Left).
   This matches the requirement: Chat 30% width (Right), Detail 70% (Left).
   Perfect.
*/
/* ================= Responsive Detail View (<1200px) ================= */
@media(min-width: 1199px){
    .read-more-btn span{
        margin-bottom: 5px;
    }
}
@media(max-height: 400px){
    .main-search-input{
        padding: 6px 15px 6px 50px;
    }
    .load-more-btn,.scroll-down-btn{
        zoom: 85%;
        padding: 4px 4px 4px 14px
    }
    .load-more-container{
        top: -39px;
    }
    .scroll-down-container{
        top: -39px;
    }
    .main-header{
        padding: 6px 1rem 4px 1rem;
    }
    .sidebar-container{
        padding: 7px 10px;
    }
    #chat-split-wrapper .detail-pane{
        height: 82%;
    }
    .input-container-card .input-row{
        padding-top: 3px;
    }
    .input-container-card{
        gap: 3px;
    }
    .main-search-input{
        font-size: 16px;
    }
    .input-bottom{
        padding: 3px 10px;
    }
    .filter-row{
        padding: 3px 5px;
    }
    .filter-chip{
        padding: 3px 12px;
    }
    .send-btn{
        width: 30px;
        height: 30px;
    }
    #chat-split-wrapper{
        padding: 5px 15px;
    }


}
@media (max-width: 1199px) {

    /* Reset Split Grid Behavior: Chat stays full width */
    #chat-split-wrapper.split-active .chat-results-container {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        border-right: none !important;
    }

    /* Reset active class effects if any specific ones exist for desktop */
    #chat-split-wrapper.split-active .chat-results-container.active {
        /* Ensure no darkening or shrinking happens if not desired,
           though 'active' class usually implies selection state.
           We just keep it visible full width. */
    }

    /* Detail Pane becomes a Bottom Sheet / Overlay */
    #chat-split-wrapper .detail-pane {
        position: absolute;
        /* Overlay relative to wrapper */
        bottom: 0;
        left: 0;
        right: 0;
        width: 100% !important;
        height: 99%;
        /* Covers most of screen */
        border-right: none;
        border-top: 1px solid var(--border-color);
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.15);
        z-index: 1000;
        margin: 0px !important;
        /* Default display: none comes from base class, which is good. */
    }

    /* Animation on Open */
    #chat-split-wrapper.split-active .detail-pane {
        display: flex;
        /* Ensure it is visible */
        animation: slideUpPane 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    }
    .chat-results-container.active .query-bubble {
    background-color: var(--purp-blk) !important;

}

#chat-split-wrapper.split-active .chat-results-container{
    background-color: transparent !important;
}

body[data-theme="dark"] #chat-split-wrapper.split-active .chat-results-container{
    background-color: transparent !important;
}
.chat-results-container.active .query-bubble{
    background-color: var(--input-bg-edit) !important;
}
.chat-results-container.active .query-textarea:disabled{
    color: var(--text-primary) !important;
}

}

@media(max-width: 768px) {
    #chat-split-wrapper .detail-pane {
        margin-right: 0px !important;
    }
    .auth-nav-btn{
        padding-bottom: 3px !important;
    }
}

@keyframes slideUpPane {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

@media(max-width: 576px) {
    .detail-action-btn span {
        display: none;
    }
     #footer-input-placeholder{
    padding: 0px;
    }
    .chat-scroll-area{
        padding: 0px 10px 20px 10px;
    }
     #chat-split-wrapper{
        padding: 0px 15px 15px 15px;
    }
    .query-textarea{
        padding: 6px 0px;
    }
}
@media(max-width: 400px) {

    .detail-action-btn span {
        display: none;
    }
    .filter-row{
        gap: 2px;
    }
    .filter-chip{
        gap: 3px;
        padding: 4px 6px;
    }

}




.detail-pane {
    border-radius: 15px;
    display: none;
    flex: 1;
    flex-direction: column;
    height: 100%;
    background-color: var(--bg-body);
    overflow: hidden;
    border: 1px solid var(--border-color);
    margin-right: 15px;
}
#chat-split-wrapper.split-active .detail-pane {
    display: flex;
}
.detail-header {
    height: 60px;
    padding: 0 20px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-body);
}
.detail-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}
.detail-actions-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.detail-action-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 5px;
}
.btn-close-detail {
    border-radius: 1000px;
    display: flex;
    width: 35px;
    height: 35px;
    align-items: center;
    justify-content: center;
}
.detail-action-btn:hover {
    background-color: var(--pill-bg);
    color: var(--text-primary);
}
.detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    color: var(--text-primary);
    background-color: var(--dt-body);
    font-size: 1.05rem;
    line-height: 1.8;
}
.detail-body::-webkit-scrollbar {
    width: 5px;
}
.detail-body::-webkit-scrollbar-track {
    box-shadow: inset 0 0 0px #5f5d5d;
    background: var(--input-bg);
}
.detail-body::-webkit-scrollbar-thumb {
    background: #3B3B7A !important;
    border-radius: 5px;
}
body[data-theme="dark"] .detail-body::-webkit-scrollbar-thumb {
    background: #3B3B7A !important;
    border-radius: 5px;
}
.detail-content-text {
    font-size: 21px;
}

/*
   ========================================
   BOOK CARD STYLES
   ========================================

   */

   :root {
    --border-color: #e5e7eb;
    --card-shadow: 0 10px 30px rgba(107, 33, 168, 0.1);
    --db-main: white;
    --db-box: #ffc2c536;
    --db-bdr2: #ededed;
    /* Typography */
    --font-main: 'Outfit', sans-serif;
}
    [data-theme="dark"]{

    --db-main: #282b30;
    --db-bdr2: #333840;
    --db-box: #1c1d1d;
    }
.dynamic-books{
    background: var(--db-main);
    border-radius: 12px;
    padding: 12px;
    /* box-shadow: var(--card-shadow); */
}
.dynamic-quran{
    background: #ffffff;
    border-radius: 12px;
    padding: 12px;
    /* box-shadow: var(--card-shadow); */
}

.dynamic-quran .main-tarjuma .tarjuma-text{
    margin-top: 10px;
    padding: 3px;
    background-color: #eaeff5;
}

[data-theme="dark"] .dynamic-quran .main-tarjuma .tarjuma-text{
   background: #202326;
}

.dynamic-hadees{
    background: #ffffff;
    border-radius: 12px;
    padding: 15px 12px;
    /* box-shadow: var(--card-shadow); */
}
.book-card {
    display: flex;
    gap: 15px;
    padding: 12px;
    border-bottom: 1px solid var(--db-bdr2);
}
.book-content{
    padding: 12px 0px;
}
.dark-filtered p{
    text-indent: unset !important;
}
[data-theme="dark"] .dark-filtered{
    /* filter: brightness(0) invert(1); */
    filter: invert(1) contrast(1) hue-rotate(74deg) brightness(1);
    color: black;
}
[data-theme="dark"] .dark-filtered p , [data-theme="dark"] .dark-filtered span{
    background-color: transparent !important;
    color: black;

}

/* Cover Image Styling */
.book-cover-container {
    flex-shrink: 0;
    width: fit-content;
    position: relative;
}

.book-cover-img {
    height: auto;
    border-radius: 12px;
    display: block;
    transition: transform 0.3s ease;
    aspect-ratio: 195/305;
    max-width: 150px;
}

/* Details Section Styling */
.book-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.book-title {
    font-size: 26px;
    color: var(--text-primary);
    line-height: 1.2;
    font-family: 'Mehr Nastaliq Web 3';
    margin-bottom: 0px;
}

/* Metadata Tags Styling */
.book-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.meta-tag {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 4px 10px;
    border: 1.5px solid #d84148;
    background-color: #d84148;
    color: white;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}
.book-content h1{
    font-size: 30px;
}
.book-content p{
    font-size: 21px;
}

.meta-icon {
    width: 16px;
    height: 16px;
}

/* Description Styling */
.book-description {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 600px;
}

/*
   ========================================
   RESPONSIVE DESIGN
   ========================================
*/
@media (max-width: 768px) {
    .book-card {
        /* flex-direction: column; */
        padding: 24px 12px;
        gap: 12px;
        text-align: center;
    }

    .book-cover-container {
        margin: 0 auto;
    }

    .book-details {
        align-items: center;
    }

    .book-title {
        font-size: 1.0rem;
    }

    .book-metadata {
        justify-content: center;
    }

    .meta-tag{
        font-size: 15px;
    }

    .book-cover-img{
        max-width: 100px;
    }
}

/* dynamic hadees */

:root{
    --dh-text: #0d413f;
    --dh-main: white;
}
[data-theme="dark"]{
    --dh-text: white;
    --dh-main: #282b30;
}

.dynamic-hadees{
    background: var(--dh-main);
    border-radius: 12px;
    padding: 15px 12px;
    margin: 12px 0px;
    /* box-shadow: var(--card-shadow); */
}
.mushkat-box-1 {
  direction: rtl;
  margin: 0px 0px 25px 0px;
  width: 100%;
}
.mushkat-box-1 h3 {
  font-size: 26px;
  font-family: "Aslam";
  margin: 0px 0px 5px 0px;
}
.mushkat-box-1 p {
  margin: 0;
  font-size: 20px;
  min-width: 75px;
}

.mushkat-img {
  width: 90px;
  height: 90px;
  aspect-ratio: 1/1;
  overflow: hidden;
  border-radius: 1000px;
  background-color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mushkat-img img{
    filter: var(--img-filter-2)
}
.mushkat-box-1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(
        90deg,
        rgba(99, 191, 114, 1) 35%,
        rgba(75, 177, 147, 1) 55%
    );;
  border-radius: 1000px;
  overflow: hidden;
  padding: 15px 16px;
  margin-bottom: 20px;
  color: white;
  min-height: 118px;
}

.muskat-b-11 {
  display: flex;
  align-items: center;
}
.mushkat-b1c {
  display: flex;
  justify-content: space-between;
  position: relative;
  min-width: 182px;
  max-width: 300px;
}
.mushkat-b1c p{
    margin: 0px;
}
.mushkat-b1c:before {
  content: "";
  position: absolute;
  width: 1px;
  height: 50%;
  background: white;
  right: 0;
  left: 45px;
  top: 0;
  bottom: 0;
  margin: auto;
}
.mushkat-b1c {
  margin-left: 25px;
}
.mushkat-h-content {
  padding: 0px 20px;
  flex: 1;
}

    @media(max-width: 576px){

        .mushkat-head p{
            font-size: 16px;
            min-width: 75px;
        }
        .mushkat-head p{
            text-align: center;
        }
        .mushkat-b1c{
            margin-left: 0px;
        }
        .mushkat-box-2 .m-writer,.mushkat-box-2 .m-total{
            font-size: 18px;
        }
        .mushkat-bookmark-i{
            font-size: 22px;
        }
        .mushkat-box-2{
            min-height: 115px;
        }
        .mushkat-b1c {
          min-width: 150px;
          max-width: 180px
      }
        .mushkat-box-1{
          padding: 2px 15px;
        }
        .mushkat-arrow-icon{
          width: 28px;
          height: 28px;
        }
        .mushkat-h-content{
            padding: 12px;
            flex: 1;
        }
        .muskat-b-11{
            width: 100%;
        }
        /* .mushkat-b1c:before {
            display: none;
        } */
        .mushkat-box-1 h3{
            font-size: 20px;
        }
        .mushkat-box-1 p{
            min-width: 80px;
            font-size: 18px;
        }
    }
    @font-face {
        font-family: "Mehr Nastaliq Web 3";
        src: url("../fonts/Mehr\ Nastaliq\ Web\ 3.ttf");
        font-display: swap;
    }
      @font-face {
        font-family: "Al-Qalam";
        src: url("../fonts/AlQalamQuranMajeedWeb2_D.otf");
        font-display: swap;
    }
      @font-face {
        font-family: "Aslam";
        src: url("../fonts/Aslam.ttf");
        font-display: swap;
    }

    .dh-body{
        width: 100%;
    }
     .h-detail-box{
        border: 1px solid #49ae9e;
        /* color: #49ae9e; */
        border-radius: 20px;
        direction: rtl;
        overflow: hidden;
        margin-bottom: 20px;
        background: red;
        background: var(--dh-main);
        width: 100%;
    }
    .h-detail-box p{
        margin: 0;
    }
    .h-detail-header{
        display: flex;
        align-items: center;
        justify-content: space-between;
        /* margin-bottom: 20px; */


    }
    .h-detail-h{
        width: 45%;
        background-color: #49ae9e;
        border-radius: 0px 0px 0px 20px;
        padding: 4px;
    }
    .h-detail-header p{
        color: white;
        white-space: nowrap;
        font-size: 26px;
        font-family: "Aslam";
        text-align: center;
        width: fit-content;
        margin: 0px auto;
    }


    .h-detail-hadees, .h-detail-tarjuma, .h-detail-sharah{
        padding: 20px;
    }
    .h-detail-hadees{
        min-height: 200px;
         transition: max-height .4s ease;
    }
    .h-detail-hadees p{
        font-family: "Al-Qalam" !important;
        font-size: 25px;
        color: var(--dh-text);
        line-height: initial !important;
    }
    .lcp-font .h-detail-hadees p{
        font-family: "Al-Qalam" !important;

    }

    .h-detail-tarjuma p{
        font-family: "Mehr Nastaliq Web 3";
        font-size: 21px;
        color: var(--dh-text);
        line-height: 1.7;
    }
     .h-detail-sharah p{
        font-family: "Mehr Nastaliq Web 3";
        font-size: 21px;
        color: var(--dh-text);
        line-height: 1.7;
    }

.withoutArab{
    display: none;
}
@media(max-width: 992px){
    .h-detail-header p{
        font-size: 25px;
    }
}
@media(max-width: 992px) and (min-width: 576px){
    .mushkat-h-content{
        flex: 1;
    }
    .mushkat-box-1 h3{
        font-size: 23px;
    }
}

@media(max-width: 768px){
    .h-detail-h{
        width: 40%;
    }
}
@media(max-width: 576px){
    .h-detail-header p {
        font-size: 20px;
    }
    .h-detail-h{
        width: 30%;
    }
    .h-detail-tarjuma p{

        line-height: 1.9;
    }
     .h-detail-sharah p{

        line-height: 1.9;
    }
    .auth-buttons-group .signup-btn{
        padding-top: 6px !important;
    }
    .auth-buttons-group .login-btn{
        padding-top: 6px !important;
    }

}
@media(max-width: 400px){
.h-detail-header p{
    font-size: 17px;
}
.theme-btns .switch{
    width: 50px;
}

}

/* dynamic hadees */


/* dynamic quran */

:root{
    --qh-text: #25292c;
    --qh-main: #e0f5f8;
    --qh-bdr: #b7e1e7;
    --qh-span: #b7e1e7;
    --qh-bdr2: #f2f2f2;
    --qh-bdr: #03869814;
}
[data-theme="dark"]{
    --qh-text: white;
    --qh-main: #209eaf;
    --qh-bdr: #209eaf;
    --qh-span: #006b79;
    --qh-bdr2: #333840;
    --qh-bdr: #03869882;
}

.dynamic-quran{
    background: var(--dh-main);
    border-radius: 12px;
    padding: 15px 12px;
    margin: 12px 0px;
    /* box-shadow: var(--card-shadow); */
}

.dq-header{
    display: flex;
    justify-content: space-between;
    gap: 5px;
    margin-bottom: 20px;
}
.dq-h-1,.dq-h-2,.dq-h-3{
    border: 0px;
    background: var(--qh-main);
    min-width: 120px;
    font-family: 'Al-Qalam-V1';
    padding: 15px 3px 15px 3px;
    border-radius: 10px;
    border: 2px solid var(--qh-bdr-2);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    position: relative;
}
.dq-h-2{
    width: 100%;
}
.dq-h-2 p:nth-child(1){
    /* border-bottom: 1px solid white; */
}
body[data-theme="dark"] .dq-h-2 p:nth-child(1){
    /* border-bottom: 1px solid #038698; */

}
.dq-h-2 p{
    font-family: "Al-Qalam" !important;
    font-size: 23px;
    margin: 0px;
    text-align: center;
    width: 100%;
    color: var(--qh-text);
}
.dq-h-1 span:nth-child(1),.dq-h-3 span:nth-child(1){
    font-family: "Al-Qalam" !important;
}
.dq-h-1 span:nth-child(2),.dq-h-3 span:nth-child(2){
    background-color: var(--qh-span);
    display: flex;
    min-width: 34px;
    justify-content: center;
    border-radius: 5px;
    font-family: sans-serif;
    font-weight: 600;
    padding: 1px 6px;
}

.dq-h-21 , .dq-h-23{
    padding: 0px 7px;
    min-width: 55px;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    position: relative;
    justify-content: space-between;
}
.dq-h-21:before , .dq-h-23:before , .dq-h-22:before , .dq-h-1:before , .dq-h-3:before{
    content: "";
    position: absolute;
    width: 70%;
    height: 1px;
    background: var(--qh-bdr);
    right: 0;
    left: 0;
    top: 0;
    bottom: 0;
    margin: auto;
}
.dq-h-22{
    width: 100%;
}
.dq-h-22:before{
    width: 96%;

}
.dq-h-23{
    border-right: 1px solid var(--qh-bdr);
}
.dq-madni{
    position: absolute;
    background: var(--qh-span);
    padding: 2px 10px;
    border-radius: 5px;
    left: 0;
    right: 0;
    bottom: -32px;
    margin: 0px auto;
    font-family: "Al-Qalam" !important;
    max-width: 280px;
    text-align: center;
}
.dq-h-22{
    position: relative;
}
.surah-ref-num{
    font-family: sans-serif !important;
    font-size: 20px !important;
}
.dq-h-22 p:nth-child(3){
    border-bottom: 1px solid white;
}
.dq-h-21{
    border-left: 1px solid var(--qh-bdr);
}
.dq-h-21 span:nth-child(2), .dq-h-23 span:nth-child(2){
    background-color: var(--qh-span);
    display: flex;
    min-width: 34px;
    justify-content: center;
    border-radius: 5px;
    font-family: sans-serif;
    font-weight: 600;
    padding: 1px 6px;
    text-align: center;
}
.dq-h-21 span:nth-child(1), .dq-h-23 span:nth-child(1){
    font-size: 1.4rem;
    font-family: "Al-Qalam" !important;
}
.dq-h-2{
    flex-direction: row;
    justify-content: space-between;
}
.main-ayat p{
    font-size: 25px;
    font-family: "Al-Qalam" !important;
    border-bottom: 1px solid var(--qh-bdr2);
    padding-bottom: 15px;
}
.main-tarjuma{
    border-bottom: 1px solid var(--qh-bdr2);
}
.main-tarjuma ,.main-tafseer{
    font-size: 21px;
}
.main-tafseer{
    padding: 15px 0px;
}
.tafseer-ref{
    padding-top: 15px;
}
.tafseer-ref p {
    color: white;
    background: var(--qh-span);
    color: var(--text-secondary);
    width: fit-content;
    padding: 4px 30px;
    border-radius: 999px;
    font-family: 'Mehr Nastaliq Web 3';
    font-size: 16px;
    margin: 0px;
}
/* [data-theme="dark"] .dq-body .main-tarjuma .tarjuma-text{
    filter: brightness(0) invert(1);
}
[data-theme="dark"] .dq-body .main-tafseer p{
    filter: brightness(0) invert(1);
} */
[data-theme="dark"] .tafseer-content p{
    /* filter: brightness(0) invert(1); */
    filter: invert(1) contrast() hue-rotate(74deg) brightness(1);
}
[data-theme="dark"] .tafseer-content span{
    /* color: black !important; */
}
.tafseer-ref p{
    filter: unset !important;
}
.home-guest-btn svg{
    color: #3B3B7A;
    margin-right: 10px;
}
[data-theme="dark"] .home-guest-btn svg{
    color: white;
}
@media(max-width: 992px){
    .dq-h-2 p{
        /* font-size: 20px; */
    }
}
@media(max-width: 900px){
    .dq-header{
        flex-wrap: wrap;
    }
    .dq-h-2{
        order: 3;
    }
    .dq-h-1{
        order: 1;
    }
     .dq-h-3{
        order: 2;
    }
    .dq-h-1, .dq-h-2, .dq-h-3{
        min-height: 100px;
        padding: 7px 3px 7px 3px;
    }
    .dq-h-2{
        padding: 7px 3px 18px 3px;
    }

}
@media(max-width: 400px){
    .dq-h-2 p{
        font-size: 17px;
    }
    .dq-h-21 span:nth-child(1), .dq-h-23 span:nth-child(1){
        font-size: 18px;
    }
    .tafseer-ref p{
    padding: 3px 30px;
    font-size: 18px;
}
}

/* dynamic quran */

/* dynamic fatawa */
.dynamic-fatawa{
    background: var(--dh-main);
    border-radius: 12px;
    padding: 15px 12px;
    margin: 12px 0px;
    /* box-shadow: var(--card-shadow); */
}
.fatawa-content{
    filter: hue-rotate(68deg);
    background-color: white;
    padding: 15px;
    border-radius: 12px;
    /* border: 2px solid #1f4e56; */
    border: 2px solid #efefef;
}
body[data-theme="dark"] .fatawa-content{
    border: 2px solid #dddddd;
}
.fatawa-content *{
    line-height: initial !important;
}
body[data-theme="dark"] .fatawa-content{
    filter: invert(1) contrast(0.8) hue-rotate(217deg) brightness(1) !important;
}
[data-theme="dark"] .dynamic-fatawa p[style="text-align: right; text-indent: 0cm; background: white; direction: rtl; unicode-bidi: embed;"], [data-theme="dark"] .dynamic-fatawa span[style="font-size: 18pt; font-family: 'Mehr Nastaliq Web', serif;"]{
    color: black;
    background: white;
}


.chat-entry{
    margin-bottom: 50px;
}

.sidebar-new-chat-row {
    padding: 0 10px 10px;
    margin-bottom: 10px;
}

.new-chat-btn {
    width: 90%;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    border-radius: 10px;
    background-color: #3B3B7A;
    padding: 13px;
    border: none;
    color: #ffffff;
}

.new-chat-btn:hover {
    background-color: #323269;
}

.chat-rename-input {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 14px;
    outline: none;              /* remove default outline */
    box-shadow: none;
}

/* focus */
.chat-rename-input:focus {
    border-color: #d0d0d0;      /* light border */
    outline: none;
    box-shadow: none;
}

/* focus-visible (important for Chrome) */
.chat-rename-input:focus-visible {
    border-color: #d0d0d0;
    outline: none;
    box-shadow: none;
}

/* editing container fix */
.history-text.editing {
    padding: 0;
}

.chat-rename-skeleton {
    height: 25px;
    width: 100%;
    border-radius: 6px;
    background: linear-gradient(
        90deg,
        #eeeeee 25%,
        #dddddd 37%,
        #eeeeee 63%
    );
    background-size: 400% 100%;
    animation: shimmer 1.4s ease infinite;
}

@keyframes shimmer {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

.chat-pin-icon {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
    color: #3B3B7A;
    font-size: 14px;
}
.chat-pin-icon.pined svg , [data-theme="dark"] .chat-pin-icon svg.ch-pinned{
    margin-left: 6px;
    fill: black;
}
[data-theme="dark"] .chat-pin-icon.pined svg ,[data-theme="dark"] .chat-pin-icon svg.ch-pinned{
    filter: brightness(0) invert(1) !important;
}

.chat-item.pinned .chat-pin-icon {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    color: black;
}

.chat-item.delete-loading {
    opacity: 0.5;            /* slightly faded while deleting */
    pointer-events: none;     /* prevent multiple clicks */
    transition: opacity 0.3s ease;
}


.no-data-box{
    background: var(--bg-sidebar);
    width: 100%;
    display: flex;
    justify-content: center;
    flex-direction: column;
    min-height: 150px;
    border-radius: 12px;
    padding: 12px;
}
.i-q-icon{
    color: #209eaf;
}
.i-h-icon{
    color: #49ae9e;

}
.i-f-icon{
    color: #3c7a6c;

}
.i-b-icon{
    color: #d84148;
}
.feedback-btn svg{
    fill: none;
}
.feedback-btn.active svg{
    fill: currentColor !important;
}
.r-danger{
    color: #ff7171;
    font-size: 18px;
}
.sidebar-user-row .dropdown-menu{
    inset: unset !important;
    margin: 0px !important;
    bottom: 41px !important;
    border: none;
    box-shadow: 0px 0px 6px #0000002b;
}
.admin-drop-btn{
    display: flex;
    align-items: center;
    gap: 5px;
    border-radius: 6px;
    padding: 3px 5px;
    transition: 0.3s
}
.admin-drop-btn:hover{
    background-color: var(--pill-bg);
}
body[data-theme="dark"] .sign-up-modal h2{
    color: white;
}
.sign-up-modal{
}
.sign-up-modal .modal-body{
    padding: 10px 20px 20px 20px !important;
    background-color: var(--bg-body);
}
body[data-theme="dark"] .sign-up-modal .custom-input{
    background-color: rgb(52 52 52 / 70%);
    border: 2px solid #37393e;
    color: white;
}
body[data-theme="dark"] .sign-up-modal .google-btn{
    background-color: white;
}
.sign-up-modal .custom-input::placeholder{
    color: #a1a1a1;
}
body[data-theme="dark"] .sign-up-modal .form-control:disabled{
    background: #272727 !important;
    color: #a8a8a8 !important;
}

.sign-up-modal h2{
    text-align: center;
    margin-bottom: 15px !important;
    color: #3B3B7A;
}
body[data-theme="dark"] .query-actions .action-btn svg{
    filter: brightness(0) invert(1) !important;
}

.no-data-box{
    background: var(--bg-sidebar);
    width: 100%;
    display: flex;
    justify-content: center;
    flex-direction: column;
    min-height: 150px;
    border-radius: 12px;
    padding: 12px;
}
.r-danger{
    color: #ff7171;
    font-size: 18px;
}


    .popup ul{
        padding: 0px !important;
    }
    .popup ul a{
        flex: 1;
    }
    ::selection{
        color: #fff;
        background: #7d2ae8;
    }
    .view-modal, .popup{
        position: fixed;
        left: 50%;
    }
    button{
        outline: none;
        cursor: pointer;
        font-weight: 500;
        border-radius: 4px;
        border: 2px solid transparent;
        transition: background 0.1s linear, border-color 0.1s linear, color 0.1s linear;
    }
    .view-modal{
        top: 10%;
        left: 90%;
        color: #e8e4ee;
        font-weight: bold;
        font-size: 18px;
        padding: 10px 25px;
        background: rgb(113, 5, 156);
        transform: translate(-50%, -50%);
    }
    .popup{
        background: var(--theme-main);
        padding: 25px;
        border-radius: 15px;
        top: 10%;
        max-width: 380px;
        width: 100%;
        opacity: 0;
        pointer-events: none;
        box-shadow: 0px 10px 15px rgba(0,0,0,0.1);
        transform: translate(-50%, -50%) scale(1.2);
        transition: top 0s 0.2s ease-in-out,
        opacity 0.2s 0s ease-in-out,
        transform 0.2s 0s ease-in-out;
        z-index: 950;
    }
    .popup img{
        width: 50px;
    }
    .popup.show{
        top: 50%;
        left: 50%;
        opacity: 1;
        pointer-events: auto;
        transform:translate(-50%, -50%) scale(1);
        transition: top 0s 0s ease-in-out,
        opacity 0.2s 0s ease-in-out,
        transform 0.2s 0s ease-in-out;
        background: var(--input-bg);
    }
    .popup :is(header, .icons, .field){
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .popup header{
            padding-bottom: 15px;
            border-bottom: 1px solid #e5e5e5;
        }
     [data-theme="dark"] .popup header{
        padding-bottom: 15px;
        border-bottom: 1px solid #3b3b3b;
    }
    .popup .icons a:hover{
        color: white !important;
        cursor: pointer;
    }
    .share-chat-title{
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-family: 'Mehr Nastaliq Web 3';
        direction: rtl;

    }

    .popup span{
        font-size: 21px;
        color: var(--text-main);
    }
    .popup .close, .icons a{
        display: flex;
        align-items: center;
        /*border-radius: 50%;*/
        justify-content: center;
        transition: all 0.3s ease-in-out;
    }
    .popup .close{
        color: #878787;
        font-size: 17px;
        background: var(--theme-main-3);
        height: 33px;
        width: 33px;
        cursor: pointer;
        border-radius: 50%;
    }
    .popup .close:hover{
        background:  #dc3545;
        color: white;

    }
    .popup .content{
        margin: 20px 0;
    }
    .popup .icons{
        margin: 15px 0 20px 0;
        gap: 15px;
    }
    .icons span{
        background: #ececec;
        padding: 8px 9px;
        border-radius: 8px;
        cursor: pointer;
        transition: 0.3s;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: 0.3s;
    }
        .icons span:hover{
            background-color: #333333;
            color: white;
            transition: 0.3s;
        }
     [data-theme="dark"] .icons span{
        background: #34373c;
    }
    /*
    [data-theme="dark"] .icons span:hover{
        background: white;
        color: #282b30;
    } */
     .icons span svg{
        color: var(--theme-svg);
        zoom: 86%;
        width: 35px !important;
        height: 35px !important;
     }
     .icons span:nth-child(1) svg{
        color: #35c436;
     }
      .icons span:nth-child(2) svg{
        color: #0080ff;
     }
      .icons span:nth-child(3) svg{
        color: black;
     }
    [data-theme="dark"] .icons span:nth-child(3) svg{
        color: white;
     }
      .icons span:nth-child(4) svg{
        color: #7575cc;
     }
     .icons span:hover svg{
        color: white !important;
     }
      .icons span:nth-child(1):hover{
        background: #35c436;
     }
      .icons span:nth-child(2):hover{
        background: #0080ff;
     }
      .icons span:nth-child(3):hover{
        background: #282b30;
     }
    [data-theme="dark"] .icons span:nth-child(3):hover{
        background: black !important;
     }
      .icons span:nth-child(4):hover{
        background: #7575cc;
     }


    .content p{
        font-size: 16px;
        color: var(--text-main)
    }
    .content .field{
        margin: 12px 0 -5px 0;
        height: 45px;
        border-radius: 4px;
        padding: 0 5px;
        border: 1px solid #757171;
    }
    .field.active{
        border-color: #7d2ae8;
    }
    .field i{
        width: 50px;
        font-size: 18px;
        text-align: center;
    }
    .field.active i{
        color: #7d2ae8;
    }
    .field input{
        width: 100%;
        height: 100%;
        border: none;
        outline: none;
        font-size: 15px;
    }
    .field button{
        color: #fff;
        padding: 5px 18px;
        background: #7d2ae8;
    }
    .field button:hover{
        background: #8d39fa;
    }
    .popupMain.show{
        position: fixed;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        background: #00000070;
        backdrop-filter: blur(12px);
        z-index: 900;
        cursor: pointer;

    }
    @media (max-width: 420px) {
        .popup{
            width: 95%;
        }
    }
#toast-container {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  display: none;
  align-items: center;
  pointer-events: none;
  user-select: none;
  animation: slide-in 0.4s ease forwards;
}

.toast-box .btn-close-detail{
    pointer-events: auto;
}

.toast-box {
  display: flex;
  align-items: center;
  border-radius: 8px;
  overflow: hidden;
  min-width: 300px;
  max-width: 90vw;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  transform: translateY(-20px);
  opacity: 0;
  animation: fade-in 0.3s forwards;
}
.toast-box {
  display: none;
}


.toast-msg {
  text-align: center;
  padding: 12px 16px;
  flex: 1;
  color: black;
  font-family: sans-serif;
  font-size: 14px;
}

/* Close button */
#toast-container button {
  background: transparent;
  border: none;
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  color: black !important;
}
body[data-theme="dark"] #toast-container .detail-action-btn svg{
filter: usnet !important;
}

/* Type colors */
.toast-error { background-color: #f31717; }   /* Red */
.toast-success { background-color: #26d366; } /* Green */
.toast-warning { background-color: #ebb75d; } /* Yellow/Orange */

.toast-error .toast-msg{
    color: #ffffff;
}

/* Animations */
@keyframes slide-in {
  0% { transform: translate(-50%, -50px); opacity: 0; }
  100% { transform: translate(-50%, 0); opacity: 1; }
}

@keyframes fade-in {
  0% { opacity: 0; transform: translateY(-10px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes fade-out {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-20px); }
}


.toast.hide {
  opacity: 0;
  transform: translateY(-20px);
}

.delete-modal{
    direction: rtl;
    background: #00000070;
    backdrop-filter: blur(12px);
}
.delete-modal .modal-content{
    background: var(--input-bg);
}
.del-btns{
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}
.del-btn{
    border-radius: 999px;
    padding: 2px 12px;
    font-family: sans-serif;
    color: #000000;
    opacity: 0.9;
    transition: 0.3s
}

[data-theme="dark"] .del-btn{
    color: #ffffff;
}

.del-btn:hover{
    opacity: 1;
}
[data-theme="dark"] .del-btn{
    background: #393b3e;
}
.del-btn:nth-child(2){
    background-color: #e02e2a;
    color: white;
}

.delete-chat{
    color: #ff0000 !important;
}
.del-confirm{
    font-family: sans-serif;
    font-weight: 600;
}
.this-will-del{
    font-family: sans-serif;
    font-weight: unset !important;
}
#chat-delete-modal .chat-title{
    font-family: sans-serif;
}

#chat-delete-modal .chat-title span{
    font-family: 'Mehr Nastaliq Web 3';
    font-weight: bold;
    margin-left: 5px !important;
}
#chat-delete-modal .chat-title span:nth-child(2){
    display: block;
    direction: rtl;
    text-align: right;
}
#chat-delete-modal .chat-title{
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

input[disabled] {
    background-color: #e7e7e7 !important; /* light gray */
    color: #333 !important; /* dark text */
    cursor: not-allowed; /* optional */
}
.btn-spinner svg {
    vertical-align: middle;
    margin-left: 5px;
}

span#resendTimer{
    margin-left:10px;
    color:#555;
    font-size:14px;
}
[data-theme="dark"] span#resendTimer{
    color: white !important;
}

.global-loader {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.head-menu-items{
    display: flex;
    align-items: center;
}

.google-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

@media(max-width: 400px){
    .dq-madni{
        bottom: -55px !important;
        max-width: 90%;
    }
    .dq-header{
        margin-bottom: 42px;
    }
}
.detail-body .dynamic-fatawa div[class="col-md-12 col-sm-12 col-xs-12"],.detail-body .dynamic-fatawa div[style="background: #EAF1DD;border-top: solid #9bbb59 2.25pt;"],.detail-body .dynamic-fatawa div[style="background: #EAF1DD;border-top:solid #9BBB59 2.25pt;"]{display:none}.detail-body .dynamic-fatawa div[class="col-md-12 col-sm-12 col-xs-12"] img,.detail-body .dynamic-fatawa div[style="background: #EAF1DD;border-top: solid #9bbb59 2.25pt;"] img,.detail-body .dynamic-fatawa div[style="background: #EAF1DD;border-top:solid #9BBB59 2.25pt;"] img{width:20px;height:20px;min-height:20px;min-width:20px;max-width:20px}
[style="text-align: left;padding: 0% 0% 3% 3%;line-height: 3;"]{
    display: none;
}
.detail-body [style="background: #EAF1DD;border-top:solid #9BBB59 2.25pt;"]{
    display: none !important;
}
.detail-body .dynamic-fatawa table{
    float: unset;
}

.mac-os .suggestion-chip{
    padding-top: 14px;
}
@media(max-height: 535px){
    .main-content-container{
        overflow: auto;
    }
}


.password-criteria-text{
    color: var(--text-secondary) !important;
}
.send-btn svg{
    width: 19px;
    height: 19px;
    display: block;
    flex-shrink: 0;
}
.feedback-btn svg{
    width: 19px;
    height: 19px;
    display: block;
    flex-shrink: 0;
}

button:disabled {
    opacity: 0.6;        /* thoda dim */
    cursor: not-allowed; /* pointer change */
    pointer-events: none; /* extra safety */
}


.show-pass-btn {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    color: #6c757d;
}

.show-pass-btn:hover {
    color: #212529;
}

.eye-icon {
    width: 20px;
    height: 20px;
}
[data-theme="dark"] .eye-icon{
    fill: #4f4f9e;
}

@media(max-width: 1199px) and (min-width: 768px){
    #chat-split-wrapper.split-active .detail-pane {
        width: 97% !important;
        margin: 0px auto !important;
    }
}



.toast-msg{
    font-family: 'Mehr Nastaliq Web 3';
    font-size: 1.0rem;
}

.sign-up-modal h2,#forgotBackToLogin,.remember-label span,#password-error,#password-confirm-error,#email-error,#name-error, #view-login h2, #view-signup h2, #view-profile h2{
    font-family: sans-serif !important;
}

/* Desktop */
#sidebar:not(.collapsed) .sidebar-toggle-btn {
    cursor: pointer !important;
}

/* font size for ipad screens only */

/* and (orientation: portrait) */
@media (min-width: 768px) and (max-width: 1200px) and (orientation: portrait){
  .filter-chip{
    font-size: 18px !important;
  }
  .suggestion-chip{
    font-size: 18px !important;
  }
  .main-search-input{
    font-size: 18px !important;
  }
  .history-text{
    font-size: 17px !important;
  }
  .main-footer{
    font-size: 18px !important;
  }
  .sidebar-dropdown a, .sidebar-dropdown button{
    font-size: 15px !important;
  }
  .card-header-badge{
    font-size: 18px !important;
  }
  .load-more-btn,.scroll-down-btn span{
    font-size: 17px !important;
  }
  .read-more-btn{
    font-size: 17px !important;
  }
   .card-body-text{
    font-size: 17px !important;
  }
  .feedback-text{
    font-size: 18px !important;
  }
  .query-textarea{
    font-size: 18px !important;
  }
}
/* Mobile */
#sidebar.mobile-open .sidebar-toggle-btn {
    cursor: pointer !important;
}
body.firefox .query-textarea{
    font-family: initial !important;
}




