/* General Body Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100dvh;
    margin: 0;
}

/* Loading Screen Styles */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #1f1c2c 0%, #2a1f3d 25%, #3d2a52 50%, #2a1f3d 75%, #1f1c2c 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    opacity: 1;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    visibility: visible;
}

.loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    text-align: center;
}

.loading-logo {
    color: #fff;
    font-size: clamp(1.55rem, 5vw, 2.5rem);
    font-weight: 700;
    letter-spacing: 0;
    animation: logoLoadingFloat 2s ease-in-out infinite;
    transform-origin: center;
}

.loading-logo span {
    color: #6E45E2;
}

@keyframes logoLoadingFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(10px) scale(1.05);
    }
}

.loading-text {
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, #ffffff 0%, #d4c5e2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.progress-bar-container {
    width: 280px;
    height: 4px;
    background: rgba(147, 112, 219, 0.2);
    border-radius: 999px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(147, 112, 219, 0.3);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #9370db, #7851a9, #6a3f8c);
    border-radius: 999px;
    width: 40%;
    animation: loadingBarSweep 1s ease-in-out infinite;
    box-shadow: 0 0 16px rgba(147, 112, 219, 0.5);
}


@keyframes loadingBarSweep {
    0% { transform: translateX(-140%); }
    100% { transform: translateX(350%); }
}

@keyframes logoSlideDown {
    from {
        transform: translateY(-200px) scale(1.5);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.loading-logo.slide-down {
    animation: logoSlideDown 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
    
/* Login Container */
.login-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #1f1c2c 0%, #2a1f3d 25%, #3d2a52 50%, #2a1f3d 75%, #1f1c2c 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 60px;
    z-index: 10000;
    flex-wrap: wrap;
    padding: 20px 20px 100px 20px;
    overflow-y: auto;
    box-sizing: border-box;
    backdrop-filter: blur(1px);
}

/* SEO intro section (also visible to Googlebot) */
.login-seo {
    max-width: 520px;
    text-align: center;
    justify-content: center;
    color: #fff;
    padding: 20px;
}

.login-seo-badge {
    display: block;
    background: rgba(147, 112, 219, 0.15);
    border: 1.5px solid rgba(147, 112, 219, 0.4);
    color: #d4c5e2;
    padding: 10px 22px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.login-seo-badge:hover {
    background: rgba(147, 112, 219, 0.25);
    border-color: rgba(147, 112, 219, 0.6);
    transform: translateY(-2px);
}

.login-seo h1 {
    font-size: 2.6rem;
    line-height: 1.15;
    font-weight: 900;
    margin-bottom: 18px;
    background: linear-gradient(135deg, #ffffff 0%, #c9b8d8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    word-wrap: break-word;
    letter-spacing: -0.01em;
}

.login-seo-tagline {
    font-size: 1.05rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 32px;
    font-weight: 500;
}

.login-seo-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.login-seo-links a {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 12px;
    background: rgba(147, 112, 219, 0.12);
    border: 1.5px solid rgba(147, 112, 219, 0.3);
    color: #d4c5e2;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.login-seo-links a:hover {
    background: rgba(147, 112, 219, 0.25);
    border-color: rgba(147, 112, 219, 0.6);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(147, 112, 219, 0.2);
    color: #e8dff0;
}

@media (max-width: 900px) {
    .login-container {
        gap: 20px;
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 60px;
    }

    .login-seo {
        max-width: 100%;
        text-align: center;
    }

    .login-seo-links {
        justify-content: center;
    }

    .login-seo h1 {
        font-size: 2rem;
    }

    .login-box {
        padding: 40px 32px;
    }
}

@media (max-width: 480px) {
    .login-seo h1 {
        font-size: 1.6rem;
    }

    .login-seo-tagline {
        font-size: 0.95rem;
    }
}

.login-box {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 30px;
    width: 90%;
    max-width: 420px;
    max-height: 82vh;
    overflow-y: auto;
    text-align: center;
    border: 1.5px solid rgba(147, 112, 219, 0.25);
    background: linear-gradient(135deg, rgba(31, 28, 44, 0.7) 0%, rgba(42, 31, 61, 0.6) 100%);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

.login-box::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(147, 112, 219, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.login-box:hover {
    transform: translateY(-12px);
    border-color: rgba(137, 93, 226, 0.445);
}

.login-logo {
    width: 95px;
    height: 95px;
    filter: drop-shadow(0 8px 16px rgba(110, 69, 226, 0.3));
    transition: transform 0.3s ease;
}

.login-box:hover .login-logo {
    transform: scale(1.10) translateY(-4px);
}

.login-box h2 {
    font-size: 1.7rem;
    margin-bottom: 12px;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, #d4c5e2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.login-greeting {
    font-size: 0.85rem;
    margin-bottom: 32px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    letter-spacing: 0.02em;
}

.login-box input[type="text"],
.login-box input[type="email"],
.login-box input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 12px;
    border-radius: 12px;
    border: 1.5px solid rgba(139, 92, 246, 0.4);
    background: rgba(139, 92, 246, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.15);
}

.login-box input[type="text"]::placeholder,
.login-box input[type="email"]::placeholder,
.login-box input[type="password"]::placeholder {
    color: rgba(255, 255, 255, 0.75);
    font-weight: 500;
}

.login-box input[type="text"]:focus,
.login-box input[type="email"]:focus,
.login-box input[type="password"]:focus {
    border-color: #A78BFA;
    outline: none;
    background: rgba(139, 92, 246, 0.18);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.15), 0 0 20px rgba(167, 139, 250, 0.3);
}

#login-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

#signup-fields {
    display: contents;
}

.login-box [hidden] {
    display: none !important;
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 48px;
}

.password-toggle {
    align-items: center;
    background: transparent;
    border: 0;
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    display: flex;
    height: 42px;
    justify-content: center;
    position: absolute;
    right: 4px;
    top: 0;
    width: 42px;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    color: #fff;
}

.login-mode-button {
    background: transparent;
    border: 0;
    color: rgba(255, 255, 255, 0.72);
    cursor: pointer;
    font-size: 0.8rem;
    margin-top: 14px;
    padding: 6px;
    transition: color 0.2s ease;
}

.login-mode-button:hover,
.login-mode-button:focus-visible {
    color: #fff;
}

.login-help-button {
    align-items: center;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.78);
    cursor: pointer;
    display: inline-flex;
    gap: 6px;
    margin: 18px;
    padding: 7px 12px;
    transition: background 0.2s ease, color 0.2s ease;
}

.login-help-button:hover {
    background: rgba(147, 112, 219, 0.2);
    color: #fff;
}

.login-help-button ion-icon {
    font-size: 1.15rem;
}

.help-popup {
    align-items: center;
    background: rgba(8, 6, 18, 0.78);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 20px;
    position: fixed;
    z-index: 11000;
}

.help-popup-content {
    background: linear-gradient(145deg, rgba(39, 31, 58, 0.98), rgba(22, 20, 35, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    color: #fff;
    max-height: min(720px, 90vh);
    max-width: 560px;
    overflow-y: auto;
    padding: 28px;
    position: relative;
    width: 100%;
}

.help-popup-close {
    background: transparent;
    border: 0;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 1.5rem;
    position: absolute;
    right: 16px;
    top: 14px;
}

.help-popup-heading {
    align-items: center;
    display: flex;
    gap: 12px;
    margin-bottom: 22px;
    padding-right: 28px;
}

.help-popup-heading > ion-icon {
    color: #bca4ff;
    font-size: 2rem;
}

.help-popup-heading h2 {
    font-size: 1.4rem;
    margin: 0 0 4px;
}

.help-popup-heading p {
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.85rem;
    margin: 0;
}

.faq-list details {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    padding: 13px 0;
}

.faq-list summary {
    cursor: pointer;
    font-weight: 650;
    padding-right: 14px;
}

.faq-list details p {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.88rem;
    line-height: 1.55;
    margin: 9px 0 0;
}

.faq-list a,
.help-contact-link {
    color: #cbbdff;
}

.help-contact-link {
    align-items: center;
    display: inline-flex;
    font-weight: 650;
    gap: 7px;
    margin-top: 20px;
}

.terms-container {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    margin-top: 8px;
    margin-bottom: 24px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    gap: 8px;
    line-height: 1.5;
}

.terms-container input[type="checkbox"] {
    cursor: pointer;
    accent-color: #9370db;
    width: 18px;
    height: 18px;
    min-width: 18px;
    border-radius: 4px;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    margin-top: 3px;
}

.terms-container input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #9370db 0%, #7851a9 100%);
    accent-color: #12b17f;
}

.terms-container a {
    color: #ff9191;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

.terms-container a:hover {
    color: #8b86cd;
    border-bottom-color: #b1abb7;
}

#signup-button {
    width: 100%;
    padding: 14px 0;
    background: linear-gradient(135deg, #9370db 0%, #7851a9 50%, #6a3f8c 100%);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 8px 20px rgba(147, 112, 219, 0.35), inset 0 1px 2px rgba(255, 255, 255, 0.2);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    margin-top: 8px;
}

#signup-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s ease;
    pointer-events: none;
}

#signup-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.1) 0%, transparent 50%, rgba(0, 0, 0, 0.1) 100%);
    border-radius: 12px;
    pointer-events: none;
}

#signup-button:hover {
    background: linear-gradient(135deg, #b8a8d8 0%, #9370db 50%, #7851a9 100%);
    box-shadow: 0 12px 28px rgba(147, 112, 219, 0.45), inset 0 1px 2px rgba(255, 255, 255, 0.25), 0 0 30px rgba(147, 112, 219, 0.25);
    transform: translateY(-3px);
}

#signup-button:hover::before {
    left: 100%;
}

#signup-button:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(147, 112, 219, 0.35), inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

/* Background animation */
@keyframes backgroundShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}


/* ============================================================
   MOBILE SWIPE NAVIGATION (intro ⇄ login form)
   Desktop (laptop/PC) keeps the original side-by-side layout.
   ============================================================ */

/* Wrapper that holds both panels side-by-side on desktop */
.login-swiper {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 60px;
    max-width: 1100px;
    width: 100%;
}

/* Each panel */
.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Desktop: intro panel keeps its width, form panel keeps its box */
.login-panel-intro {
    width: 560px;
}

.login-panel-form {
    width: 375px;
}

.login-panel-form .login-box {
    width: 100%;
}

.login-swipe-dots,
.login-swipe-hint {
    display: none;
}

/* ---------- Mobile / tablet: horizontal snap carousel ---------- */
@media (max-width: 900px) {
    .login-container {
        flex-direction: column;
        justify-content: flex-start;
        gap: 0;
        padding: 60px 0 84px 0;
        overflow: hidden;
        height: 100dvh;
    }

    .login-swiper {
        display: flex;
        flex-wrap: nowrap;
        width: 100%;
        max-width: none;
        gap: 0;
        overflow-x: auto;
        overflow-y: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        align-items: flex-start;
        justify-content: flex-start;
        flex: 1;
        min-height: 0;
    }

    .login-swiper::-webkit-scrollbar {
        display: none;
    }

    .login-panel {
        width: 100%;
        min-width: 100%;
        min-height: 100%;
        flex-shrink: 0;
        scroll-snap-align: start;
        box-sizing: border-box;
        padding: 20px 24px;
        align-items: flex-start;
        justify-content: center;
        backface-visibility: hidden;
    }

    .login-panel-intro {
        width: 100%;
    }

    .login-panel-form {
        width: 100%;
    }

    .login-box {
        width: 100%;
        max-width: 375px;
        margin: auto;
    }

    .login-seo {
        width: 100%;
        max-width: 460px;
        margin: auto;
        text-align: center;
        box-sizing: border-box;
        padding: 12px;
    }

    .login-seo-links {
        justify-content: center;
    }

    /* Show dots + hint only on mobile */
    .login-swipe-dots {
        display: flex;
        justify-content: center;
        gap: 8px;
        margin: 16px auto 0 auto;
        padding: 0 24px;
    }

    .swipe-dot {
        width: 8px;
        height: 8px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.3);
        transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 0 0 8px rgba(147, 112, 219, 0.1);
    }

    .swipe-dot.active {
        width: 28px;
        background: linear-gradient(90deg, #9370db, #7851a9);
        box-shadow: 0 0 16px rgba(147, 112, 219, 0.5);
    }

    .login-swipe-hint {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        margin: 20px auto 0 auto;
        padding: 8px 16px;
        color: rgba(255, 255, 255, 0.8);
        font-size: 0.8rem;
        font-weight: 600;
        animation: swipeHintPulse 2s ease-in-out infinite;
        backdrop-filter: blur(10px);
        background: rgba(147, 112, 219, 0.1);
        border: 1px solid rgba(147, 112, 219, 0.2);
        border-radius: 999px;
        letter-spacing: 0.03em;
    }

    .login-swipe-hint ion-icon {
        font-size: 1.2rem;
        color: #9370db;
    }

    .login-swipe-hint.fade-out {
        animation: none;
        opacity: 0;
        transform: translateY(-6px);
        transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        pointer-events: none;
    }

    @keyframes swipeHintPulse {
        0%, 100% { 
            opacity: 0.8; 
            transform: translateY(0) scale(1);
        }
        50% { 
            opacity: 1; 
            transform: translateY(3px) scale(1.05);
        }
    }

    /* Premium entrance animation for the form slide */
    .login-panel-form .login-box {
        opacity: 0;
        transform: translate3d(0, 20px, 0) scale(0.98);
        transition: opacity 0.55s ease-out, transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
        will-change: opacity, transform;
    }

    .login-container.on-form .login-panel-form .login-box {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }

    .login-panel-intro .login-seo,
    .login-panel-form .login-box {
        opacity: 0.72;
        transform: translate3d(0, 8px, 0);
        transition: opacity 0.3s ease-out, transform 0.3s ease-out;
        will-change: opacity, transform;
    }

    .login-panel.panel-active .login-seo,
    .login-panel.panel-active .login-box {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* ---------- Small phones: tighten hint + dots ---------- */
@media (max-width: 480px) {
    .login-swipe-hint {
        font-size: 0.78rem;
        margin-top: 8px;
    }
}

/* Desktop (above 900px): ensure the two panels look identical to the original layout */
@media (min-width: 901px) {
    .login-swiper {
        gap: 60px;
    }
}

/* User Menu Styles */
.user-menu-wrapper {
    top: 7px;
    right: 2vw;
    position: absolute; /* Positioning the user menu */
    
}

#user-icon {
    width: 40px; /* Increase logo size */
    height: 40px; /* Increase logo size */
    cursor: pointer; /* Change cursor to pointer on hover */
}
.user-menu {
    background: rgba(43, 43, 43, 0.980);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 25px;
    min-width: 300px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    font-family: 'Segoe UI', sans-serif;
    position: absolute;
    right: 0;
    top: 50px;
    display: none;
    color: #fff;
}

/* Style each user info block */
.user-info p {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
    font-size: 15px;
    font-weight: 500;
    color: #ddd;
}

/* Label inside <strong> */
.user-info p strong {
    flex-shrink: 0;
    width: 90px;
    color: #bbb;
    font-weight: 600;
}

/* Span values like email/username */
.user-info span {
    flex-grow: 1;
    text-align: right;
    color: #f5f5f5;
    font-weight: 500;
    word-break: break-word;
}

/* Verified badge aligned with username */
#user-username {
    display: inline;
}

.verified-badge {
    vertical-align: middle;
    margin-left: 5px;
}

/* Logout button */
#logout-button {
    width: 100%;
    padding: 10px;
    margin-top: 20px;
    background: #e53935;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease;
}

#logout-button:hover {
    background: #641717;
}


    /* Chatbot Container Styles */
    .chatbot-container {
    width: 100%; /* Sets the width to 100% */
    height: 100%; /* Sets the height to 100% */
    overflow: hidden; /* Hides any overflowing content */
    background: linear-gradient(135deg, #1f1c2c, #928dab); /* Sets the background color using a linear gradient */
    box-shadow: 0 10px 30px rgb(0 0 0 / 0.3); /* Adds a shadow */
    backdrop-filter: blur(15px); /* Applies a blur effect */
    position: relative; /* Sets the position to relative for positioning children */
    display: flex; /* Uses flexbox */
    flex-direction: column; /* Stacks items vertically */
    animation: fadein 0.8s ease-in-out; /* Applies a fade-in animation */
    }
    
    /* Chatbot Header Styles */
    .chatbot-header {
        background-color: rgb(41, 41, 41);
        backdrop-filter: blur(30px);
        -webkit-backdrop-filter: blur(30px);
        color: #fff;
        padding: 15px;
        width: 85%;
        margin: 20px auto;
        display: flex;
        justify-content: center;
        border-radius: 25px;
        text-align: center;
        font-size: 3vh;
        background: var(--glass);
            backdrop-filter: blur(30px);
            box-shadow: 0 5px 20px rgba(0, 0, 0, 0.664);
            padding: 1rem 5%;
        font-weight: 700;
        z-index: 9999;
    }
    
    /* Chatbot Messages Styles */
    .chatbot-messages {
    padding: 15px; /* Adds padding */
    flex: 1; /* Allows the messages area to grow and fill available space */
    overflow-y: auto; /* Adds a vertical scrollbar if needed */
    display: flex; /* Uses flexbox */
    flex-direction: column; /* Stacks items vertically */
    gap: 10px; /* Adds a gap between messages */
    margin-bottom: 120px; /* Increased space for input container */
    }
    
    /* Message Styles */
    .message {
    max-width: 70%; /* Sets the maximum width */
    padding: 20px; /* Adds padding */
    border-radius: 10px; /* Rounds the corners */
    box-shadow: 0 2px 5px rgb(0 0 0 / 0.1); /* Adds a subtle shadow */
    opacity: 0; /* Initially hidden */
    animation: messagefadein 0.5s forwards; /* Applies a fade-in animation */
    }
    
    .message-in {
        margin-left: 20px;
        max-width: 75%;
        background: rgba(182, 182, 182, 0.82); /* glass effect */
        border: 1px solid rgba(255, 255, 255, 0.2);
        backdrop-filter: blur(30px);
        -webkit-backdrop-filter: blur(30px);
        border-radius: 20px;
        color: #1f1f1f;
        align-self: flex-start;
        box-shadow: 0 8px 24px rgba(0, 0, 1, 0.3);
        animation: fadeInSlide 0.3s ease-out both;
        transition: all 0.5s ease-in-out;
    }
    
    /* Animation */
    @keyframes fadeInSlide {
       
            0% {
                opacity: 0;
                transform: translateY(15px) scale(0.9);
            }
            60% {
                transform: translateY(-5px) scale(1.03);
            }
            100% {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        
    }
   
        
      
/* Styles for code blocks in chat messages */
.message-content pre {
    background-color: #2d2d2d;
    color: #f8f8f2;
    padding: 12px;
    border-radius: 8px;
    overflow: auto;
    font-size: 14px;
    white-space: pre;
    word-wrap: normal;
    margin: 12px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    font-family: 'Fira Code', 'Consolas', monospace;
  }
  
  .message-content code {
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 15px;
    font-family: 'Fira Code', 'Consolas', monospace;
    color: inherit; /* ensure code is visible by default */
    -webkit-text-fill-color: initial;
    background: transparent;
  }

/* Ensure code inside pre uses readable color (avoid gradient text inside code blocks) */
.message-content pre code {
    color: #f8f8f2 !important;
    background: transparent !important;
    -webkit-text-fill-color: initial !important;
    white-space: pre !important;
    font-family: 'Fira Code', 'Consolas', monospace;
}

/* ===== Markdown Tables in Chat Messages ===== */
.message-content .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 12px 0;
    border-radius: 10px;
    border: 1px solid rgba(110, 69, 226, 0.25);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    max-width: 100%;
}

.message-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    line-height: 1.45;
    min-width: 320px;
    background: rgba(255, 255, 255, 0.04);
    color: inherit;
}

.message-content thead th {
    background: rgba(110, 69, 226, 0.22);
    color: #ffffff;
    font-weight: 700;
    text-align: left;
    padding: 10px 14px;
    border-bottom: 2px solid rgba(110, 69, 226, 0.45);
    white-space: nowrap;
}

.message-content tbody td {
    padding: 9px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    vertical-align: top;
    word-break: break-word;
}

.message-content tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.03);
}

.message-content tbody tr:last-child td {
    border-bottom: none;
}

.message-content tbody tr:hover {
    background: rgba(110, 69, 226, 0.08);
}

/* Dark mode table adjustments */
body.dark-mode .message-content .table-wrapper {
    border-color: rgba(255, 255, 255, 0.12);
}

body.dark-mode .message-content thead th {
    background: rgba(110, 69, 226, 0.3);
    border-bottom-color: rgba(110, 69, 226, 0.6);
}

body.dark-mode .message-content tbody td {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

/* Mobile: allow tables to scroll horizontally */
@media (max-width: 480px) {
    .message-content table {
        font-size: 0.82rem;
        min-width: 260px;
    }
    .message-content thead th,
    .message-content tbody td {
        padding: 7px 10px;
    }
}

/* Give messages extra right padding so buttons don't overlap content */
.message-in, .message-out {
    padding-right: 72px;
}

body[data-font-size="small"] .message-content {
    font-size: 0.9em;
}

body[data-font-size="large"] .message-content {
    font-size: 1.12em;
}

/* Position copy / regenerate buttons on the right side with clear gap */
.message-in .copy-btn, .message-in {
    left: auto;
    right: 10px;
}
.message-in .regenerate-btn {
    right: 20px;
}
  
    .message-out {
        margin: 20px;
        max-width: 70%;
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        color: #f5f5f5;
        box-shadow: 0 8px 24px rgba(0, 0, 1, 0.3);
        border-radius: 25px;
        align-self: flex-end;
        animation: bounceFade 0.5s ease-out both;
        position: relative;
        transition: all 0.5s ease-in-out;
    }
    
    /* Animation */
    @keyframes bounceFade {
        0% {
            opacity: 0;
            transform: translateY(15px) scale(0.9);
        }
        60% {
            transform: translateY(-5px) scale(1.03);
        }
        100% {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }
   
    
    /* Typing Indicator Styles */
    .typing-indicator {
        position: absolute;
        top: 0.5em;
        left: 9px;
        padding: 4px;
        display: none;
        background: transparent;
        border: none;
        border-radius: 4px;
        z-index: 2;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .typing-indicator.visible {
        display: flex;
        align-items: center;
        opacity: 1;
    }
    
    .typing-indicator .dot {
        display: inline-block;
        width: 4px;
        height: 4px;
        margin: 0 2px;
        background-color: #535353af;
        border-radius: 50%;
        animation: blink 0.5s infinite both;
    }
    
    .typing-indicator .dot:nth-child(2) {
        animation-delay: 0.2s;
    }
    
    .typing-indicator .dot:nth-child(3) {
        animation-delay: 0.3s;
    }
    
    @keyframes blink {
        50% {
            opacity: 0.5;
        }
    }

    /* Copy Button Styles */
    .copy-btn, .regenerate-btn {
        position: relative;
        font-size: 1rem;
        color: #6d6c6c;
        cursor: pointer;
        transition: all 0.3s ease;
        padding: 10px;
        z-index: 2;
        opacity: 1;
    }


    .copy-btn.hidden, .regenerate-btn.hidden {
        opacity: 0;
        visibility: hidden;
    }

    .copy-btn:hover, .regenerate-btn:hover {
        color: #ace2a2;
    }
    
    /* Chatbot Input Styles */
.chatbot-input {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    padding: 15px;
    background: transparent;
}

.chatbot-input .input-row {
    display: flex;
    width: 90%;
    padding: 10px;
    margin: 0 auto;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 8px;
    border-radius: 15px;
    text-align: center;
    background-color: #ffffff;
    position: relative;
}

.input-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
    position: relative;
}

.chatbot-input textarea {
    width: 100%;
    max-height: 100px;
    padding: 10px;
    border: none;
    border-radius: 15px;
    outline: none;
    font-size: 16px;
    resize: none;
    overflow-y: auto;
    line-height: 1.4;
    font-family: inherit;
}

/* Scrollbar styling for the textarea */
.chatbot-input textarea::-webkit-scrollbar {
    width: 6px;
}

.chatbot-input textarea::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-input textarea::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.chatbot-input textarea::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Dark mode support for textarea */
body.dark-mode .chatbot-input textarea {
    background-color: transparent;
    color: #fff;
}

.bottom-buttons {
    display: flex;
    gap: 8px;
    margin-left: 10px;
}

.chatbot-input input {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 15px;
    outline: none;
    font-size: 16px;
}

.mini-option-btn {
    background: #0505051f;
    backdrop-filter: blur(30px);
    border: 1px solid rgba(59, 59, 59, 0.712);
    color: #292929;
    padding: 5px 13px;
    border-radius: 15px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.mini-option-btn:hover {
    background: rgba(110, 69, 226, 0.3);
    border-color: rgba(49, 17, 138, 0.767);
    transform: translateY(-1px);
}

#send-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #202020;
    font-size: 2.8em;
    align-self: center;
}

#send-button:hover {
    color: #3f3f3f;
}

/* Download App Popup Styles */
.download-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100000;
}

.download-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.download-popup-content {
    position: relative;
    background: rgba(43, 43, 43, 0.55);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    padding: 36px 32px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: popup-entrance 0.4s cubic-bezier(0.4, 1.6, 0.6, 1) both;
    color: #fff;
}

.download-close-icon {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 28px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
    z-index: 2;
}

.download-close-icon:hover {
    color: #6E45E2;
    transform: rotate(90deg);
}

.download-popup-header {
    text-align: center;
    margin-bottom: 28px;
}

.download-popup-icon {
    font-size: 48px;
    color: #6E45E2;
    margin-bottom: 12px;
    display: inline-block;
}

.download-popup-header h2 {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0 0 8px 0;
    color: #fff;
}

.download-subtitle {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

.download-benefits {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 28px;
}

.download-steps {
    display: none;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 14px 16px;
    animation: fadeInSlide 0.3s ease-out both;
}

.step-number {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6E45E2, #8B5CF6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
}

.step-text {
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    line-height: 1.4;
}

.step-text strong {
    color: #8B5CF6;
}

@media (max-width: 480px) {
    .step-item {
        padding: 12px 14px;
    }
    .step-text {
        font-size: 0.85rem;
    }
    .step-number {
        width: 26px;
        height: 26px;
        min-width: 26px;
        font-size: 0.75rem;
    }
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 12px 16px;
    transition: all 0.3s ease;
}

.benefit-item:hover {
    background: rgba(110, 69, 226, 0.1);
    border-color: rgba(110, 69, 226, 0.2);
    transform: translateX(4px);
}

.benefit-item ion-icon {
    font-size: 22px;
    color: #6E45E2;
    flex-shrink: 0;
}

.benefit-item span {
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    line-height: 1.3;
}

.download-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.download-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, #6E45E2, #8B5CF6);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(110, 69, 226, 0.4);
}

.download-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(110, 69, 226, 0.5);
}

.download-btn-primary:active {
    transform: translateY(0);
}

.download-btn-primary ion-icon {
    font-size: 20px;
}





@media (max-width: 480px) {
    .download-popup-content {
        padding: 28px 20px;
        max-width: 360px;
    }

    .download-popup-header h2 {
        font-size: 1.3rem;
    }

    .benefit-item {
        padding: 10px 14px;
    }

    .benefit-item span {
        font-size: 0.85rem;
    }

    .download-btn-primary {
        padding: 12px;
        font-size: 0.95rem;
    }
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .chatbot-input {
        padding: 10px;
    }

    .chatbot-input .input-row {
        width: 95%;
        padding: 8px;
        gap: 6px;
    }

    .input-column {
        gap: 3px;
    }

    .bottom-buttons {
        gap: 6px;
        margin-left: 8px;
    }

    .mini-option-btn {
        padding: 3px 10px;
        font-size: 0.85rem;
    }

    .chatbot-input input {
        font-size: 14px;
    }

    #more-icon {
        font-size: 2.4em;
    }

    #send-button {
        font-size: 2.4em;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    display: none;
}

/* ===== PREMIUM NOTIFICATION SYSTEM ===== */
.roudex-notifications {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000002;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    width: min(420px, 92vw);
    max-height: 80vh;
    overflow-y: visible;
}

.roudex-notification {
    pointer-events: auto;
    position: relative;
    background: rgba(30, 30, 40, 0.88);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border-radius: 18px;
    padding: 16px 20px;
    padding-right: 48px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.45;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: rdx-notif-in 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
    cursor: default;
    transition: opacity 0.35s ease, transform 0.35s ease;
    overflow: hidden;
}

.rdx-activity-notification {
    border-radius: 13px;
    font-size: 0.86rem;
    padding: 11px 16px;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.rdx-activity-notification .rdx-notif-icon {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    height: 27px;
    width: 27px;
}

.rdx-activity-notification .rdx-notif-icon ion-icon {
    font-size: 1rem;
}

.rdx-activity-notification .rdx-notif-close {
    right: 8px;
    font-size: 1rem;
}

.roudex-notification::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 18px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.02));
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* Notification Type Variations */
.roudex-notification.rdx-type-info {
    background: rgba(30, 30, 50, 0.92);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(110, 69, 226, 0.25), 0 0 30px rgba(110, 69, 226, 0.08);
}
.roudex-notification.rdx-type-info .rdx-notif-icon {
    color: #8B5CF6;
}

.roudex-notification.rdx-type-warning {
    background: rgba(40, 30, 20, 0.92);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(245, 158, 11, 0.25), 0 0 30px rgba(245, 158, 11, 0.06);
}
.roudex-notification.rdx-type-warning .rdx-notif-icon {
    color: #F59E0B;
}

.roudex-notification.rdx-type-success {
    background: rgba(20, 40, 30, 0.92);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(16, 185, 129, 0.25), 0 0 30px rgba(16, 185, 129, 0.06);
}
.roudex-notification.rdx-type-success .rdx-notif-icon {
    color: #10B981;
}

.roudex-notification.rdx-type-error {
    background: rgba(40, 20, 20, 0.92);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(239, 68, 68, 0.25), 0 0 30px rgba(239, 68, 68, 0.06);
}
.roudex-notification.rdx-type-error .rdx-notif-icon {
    color: #EF4444;
}

.rdx-notif-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
}

.rdx-notif-icon ion-icon {
    font-size: 1.2rem;
}

.rdx-notif-close {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    border-radius: 8px;
}

.rdx-notif-close:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.06);
}

.rdx-notif-text {
    flex: 1;
}

.rdx-notif-text strong {
    font-weight: 700;
    color: #fff;
}

.rdx-upgrade-btn {
    display: inline-block !important;
    margin-top: 10px !important;
    margin-left: 10px;
    padding: 8px 20px !important;
    background: linear-gradient(135deg, #6E45E2, #8B5CF6) !important;
    color: #ffffff !important;
    border-radius: 12px !important;
    border: none !important;
    font-weight: 700 !important;
    font-size: 0.82rem !important;
    text-decoration: none !important;
    transition: all 0.25s ease !important;
    box-shadow: 0 4px 14px rgba(110, 69, 226, 0.4) !important;
    letter-spacing: 0.03em !important;
    text-align: center !important;
    cursor: pointer !important;
    line-height: 1.4 !important;
    width: fit-content !important;
}

.rdx-upgrade-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 24px rgba(110, 69, 226, 0.55) !important;
    background: linear-gradient(135deg, #7c5af0, #9d6ffa) !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

/* Animations */
@keyframes rdx-notif-in {
    0% {
        opacity: 0;
        transform: translateY(-24px) scale(0.92);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes rdx-notif-out {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-20px) scale(0.92);
    }
}

.roudex-notification.rdx-exit {
    animation: rdx-notif-out 0.35s ease-in both;
}

.rdx-dialog-backdrop {
    align-items: center;
    background: rgba(5, 4, 12, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 20px;
    position: fixed;
    z-index: 1000005;
}

.rdx-dialog {
    background: linear-gradient(145deg, rgba(48, 40, 72, 0.98), rgba(28, 28, 36, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.48);
    color: #fff;
    max-width: 420px;
    padding: 24px;
    width: 100%;
}

.rdx-dialog h2 {
    font-size: 1.2rem;
    margin: 0 0 8px;
}

.rdx-dialog p {
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.5;
    margin: 0 0 18px;
}

.rdx-dialog input {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    box-sizing: border-box;
    color: #fff;
    padding: 11px;
    width: 100%;
}

.rdx-dialog input:focus {
    border-color: #a78bfa;
    outline: none;
}

.rdx-dialog-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 18px;
}

.rdx-dialog-actions button {
    border-radius: 8px;
    cursor: pointer;
    padding: 9px 14px;
}

.rdx-dialog-cancel {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #fff;
}

.rdx-dialog-confirm {
    background: #6e45e2;
    border: 1px solid #8b6de8;
    color: #fff;
}

/* Dark mode support - notifications are already dark by design */
body.dark-mode .roudex-notification {
    background: rgba(20, 20, 30, 0.92);
}

/* Mobile responsive */
@media (max-width: 480px) {
    .roudex-notifications {
        top: 12px;
        width: calc(100vw - 24px);
    }
    .roudex-notification {
        padding: 14px 16px;
        padding-right: 44px;
        font-size: 0.9rem;
        border-radius: 14px;
    }
    .rdx-notif-icon {
        width: 28px;
        height: 28px;
        font-size: 1.2rem;
    }
    .rdx-notif-icon ion-icon {
        font-size: 1rem;
    }
}
    
    
   
    /* Animations */
    @keyframes popup-entrance {
    0% {
    opacity: 0;
    transform: scale(0.7);
    }
    100% {
    opacity: 1;
    transform: scale(1);
    }
    }
    
    @keyframes fadein {
    to {
    opacity: 1;
    }
    }
    
    @keyframes messagefadein {
    to {
    opacity: 1;
    }
    }
    
    @keyframes blink {
    50% {
    opacity: 0.5;
    }
    }

#send-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #202020;
}

#send-button:hover{
    color: #3f3f3f;
}

#stop-icon {
    display: none; 
}

#stop-icon:hover{
    color: #3f3f3f;
}


.greeting-username {
    font-weight: 600;
 color: #6E45E2;
}
.copy-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.9rem;
    animation: fadeOut 2s forwards;
    z-index: 1000;
}

@keyframes fadeOut {
    0% { opacity: 1; }
    90% { opacity: 1; }
    100% { opacity: 0; }
}

.message {
    position: relative;
    padding-right: 20px;
}

#more-icon {
    font-size: 2.8em;
    cursor: pointer;
    margin: auto;
    color: #202020;
    transition: 0.2s ease-in-out;
   
}



.more-menu {
    position: absolute;
    bottom: 7.5em;
    display: none;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    background: rgba(68, 68, 68, 0.295);
    border-radius: 20px;
    padding: 5px;
    width: 10em;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-direction: column;
    gap: 10px;
    z-index: 999;
    transition: opacity 3s ease, transform 3s ease;
}

.menu-item {
    background-color: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 15px;
    padding: 9px;
    position: relative;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    text-align: center;
}

.menu-item,a{
    text-decoration: none;
    color: #fff;
}
.menu-item:hover {
    background-color: rgba(255, 255, 255, 0.25);
    transform: scale(1.03);
}

.socials-section {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 3px;
    padding: 9px 4px 4px;
}

.socials-toggle {
    align-items: center;
    background: transparent;
    border: 0;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    justify-content: space-between;
    letter-spacing: 0.08em;
    padding: 0 0 7px;
    text-align: left;
    text-transform: uppercase;
    width: 100%;
}

.socials-toggle ion-icon {
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.socials-toggle[aria-expanded="true"] ion-icon {
    transform: rotate(180deg);
    animation: socials-toggle-pulse 0.45s ease-out;
}

.socials-toggle:hover,
.socials-toggle:focus-visible {
    color: #fff;
}

@keyframes socials-toggle-pulse {
    0% {
        transform: rotate(180deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(1.2);
    }
    100% {
        transform: rotate(180deg) scale(1);
    }
}

.socials-section h3 {
    margin: 0 0 7px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-align: left;
    text-transform: uppercase;
}

.social-link {
    align-items: center;
    border-radius: 10px;
    display: flex;
    gap: 7px;
    padding: 7px 5px;
    color: #fff;
    font-size: 0.78rem;
    transition: background-color 0.2s ease;
}

.social-links:not([hidden]) .social-link {
    animation: social-link-reveal 0.25s ease-out both;
}

.social-links:not([hidden]) .social-link:nth-child(2) {
    animation-delay: 0.06s;
}

@keyframes social-link-reveal {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.social-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.social-link ion-icon {
    flex: 0 0 auto;
    font-size: 1.05rem;
}

.social-link span {
    color: rgba(255, 255, 255, 0.65);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
    .socials-toggle ion-icon,
    .social-links:not([hidden]) .social-link {
        animation: none;
        transition: none;
    }
}

.premium-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8); /* Darker semi-transparent background */
    backdrop-filter: blur(15px); /* More pronounced blur effect */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000; /* Ensure it is on top */
}

.premium-popup-content {
    background: linear-gradient(135deg, #d4d4d4, #555555);
    border-radius: 20px;
    padding: 30px;
    width: 70%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.5s ease-in-out;
    transition: transform 0.3s ease;
    position: relative;
}

.premium-popup-content:hover {
    transform: scale(1.05);
}

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

.close-popup-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #333;
    transition: all 0.3s ease;
}

.close-popup-icon:hover {
    color: #000;
    transform: rotate(90deg);
}

.buy-button {
    background: linear-gradient(135deg, #01d676, #1fb10c);
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 16px 44px;
    margin-top: 12px;
    border: none;
    border-radius: 27px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease-in-out;
}
   
.buy-button:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 10px 20px rgba(0, 200, 111, 0.4);
}

/* Spinner Loader Styles */
.spinner-loader {
    position: absolute;
    top: 0.4em;
    left: 6.5px;
    width: 20px;
    height: 20px;
    display: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.spinner-loader.visible {
    display: block;
    opacity: 1;
}

.spinner-loader::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid #535353af;
    border-top-color: #3d1c99;
    box-shadow: 0 0 10px rgba(79, 63, 150, 0.521);
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}


.edit-btn {
    position: absolute;
    top: 0.2em;
    right: 3px;
    font-size: 1.2rem;
    color: #6d6c6c;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 4px;
    border-radius: 4px;
    z-index: 2;
    opacity: 1;
}

.edit-btn:hover {
    color: #ace2a2;
}

.message-out {
    position: relative;
    padding-right: 35px;
}

/* Edit mode styles */
.message-content.editing {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px;
    border-radius: 8px;
    outline: none;
}

.edit-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    justify-content: flex-end;
}

.edit-actions button {
    padding: 4px 12px;
    border-radius: 15px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.save-edit {
    background: rgba(110, 69, 226, 0.3);
    color: #fff;
}

.cancel-edit {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.save-edit:hover {
    background: rgba(110, 69, 226, 0.5);
}

.cancel-edit:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* User Menu Styles */
.user-menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 15px 0;
}

.menu-button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.menu-button:hover {
    background: rgba(110, 69, 226, 0.3);
}

.menu-button ion-icon {
    font-size: 18px;
}

/* Settings Panel */
.settings-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 350px;
    height: 100vh;
    max-width: 100vw;
    box-sizing: border-box;
    background: rgba(43, 43, 43, 0.205);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(30px);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding: 20px;
    transition: right 0.3s ease;
    z-index: 100000;
    color: #fff;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
}

/* Keep login surfaces usable on short and narrow phones. */
@media (max-width: 600px) {
    .login-container {
        padding: 28px 0 72px;
    }

    .login-swiper {
        overflow-x: auto;
        overflow-y: auto;
    }

    .login-panel {
        min-height: auto;
        padding: 16px;
    }

    .login-panel-form {
        align-items: flex-start;
    }

    .login-box {
        max-width: 100%;
        max-height: none;
        padding: 28px 20px 24px;
        overflow: visible;
    }

    .login-logo {
        width: 68px;
        height: 68px;
        margin-bottom: 14px;
    }

    .login-box h2 {
        font-size: 1.4rem;
        margin-bottom: 9px;
    }

    .login-greeting {
        margin-bottom: 22px;
    }

    .login-seo {
        max-width: 100%;
        padding: 8px 4px 20px;
    }

    .login-seo-badge {
        margin-bottom: 16px;
        padding: 8px 12px;
        font-size: 0.76rem;
    }

    .login-seo h1 {
        font-size: clamp(1.35rem, 7vw, 1.75rem);
        line-height: 1.2;
        margin-bottom: 12px;
    }

    .login-seo-tagline {
        font-size: 0.88rem;
        line-height: 1.5;
        margin-bottom: 20px;
    }

    .login-seo-links {
        gap: 7px;
    }

    .login-seo-links a {
        padding: 8px 10px;
        font-size: 0.78rem;
    }

    .settings-panel {
        width: min(350px, 100vw);
        height: 100dvh;
        padding: 16px 16px calc(20px + env(safe-area-inset-bottom));
    }
}

.settings-panel.active {
    right: 0;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.settings-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close-settings {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 5px;
    transition: color 0.3s ease;
}

.close-settings:hover {
    color: #6E45E2;
}

.settings-section {
    margin-bottom: 20px;
}

.settings-help-text {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.82rem;
    line-height: 1.45;
    margin: -4px 0 12px;
}

.update-modal {
    align-items: center;
    background: rgba(5, 4, 12, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    inset: 0;
    justify-content: center;
    padding: 20px;
    position: fixed;
    z-index: 100002;
}

.update-modal-content {
    background: linear-gradient(145deg, rgba(48, 40, 72, 0.98), rgba(28, 28, 36, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    max-width: 460px;
    padding: 24px;
    width: 100%;
}

.update-kicker {
    color: #b9a2ff;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.update-modal-content h2 {
    margin: 4px 0 0;
}

.update-status-row {
    align-items: center;
    display: flex;
    gap: 10px;
    margin: 22px 0 12px;
    color: #9558ff;
}

.update-status-row ion-icon {
    color: #a78bfa;
    font-size: 1.35rem;
}

.version-grid {
    display: grid;
    gap: 9px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 16px 0;
}

.version-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
}

.version-card span {
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.7rem;
    text-transform: uppercase;
}

.version-card strong {
    color: #ace2a2;
    font-size: 0.95rem;
}

.version-current {
    border-color: rgba(167, 139, 250, 0.4);
}

.version-current strong {
    color: #c4b5fd;
}

.release-notes {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 14px 0;
    padding-top: 14px;
}

.release-notes-heading {
    align-items: center;
    color: #fff;
    display: flex;
    gap: 7px;
    margin-bottom: 8px;
}

.release-notes-heading ion-icon {
    color: #c4b5fd;
}

.release-notes ul {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    line-height: 1.5;
    margin: 0;
    padding-left: 18px;
}

.release-notes li + li {
    margin-top: 3px;
}

.update-progress-track {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    height: 6px;
    overflow: hidden;
}

#update-progress-bar {
    background: linear-gradient(90deg, #6e45e2, #a78bfa);
    border-radius: inherit;
    height: 100%;
    transition: width 0.45s ease;
    width: 0;
}

.update-status-text {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.88rem;
    line-height: 1.5;
    margin: 14px 0;
}

.update-modal-actions {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 18px;
}

.update-secondary-button {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    padding: 9px 14px;
}

.update-secondary-button:hover {
    background: rgba(255, 255, 255, 0.14);
}

.profile-summary {
    align-items: center;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    margin-bottom: 14px;
}

.profile-summary > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-summary-label {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.profile-summary strong {
    color: #fff;
    font-size: 0.98rem;
}

.profile-summary span:not(.profile-summary-label) {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.82rem;
}

.plan-summary {
    align-items: flex-end;
    text-align: right;
}

.plan-summary strong {
    color: #b9a2ff;
}

.edit-profile-button {
    align-items: center;
    background: rgba(110, 69, 226, 0.18);
    border: 1px solid rgba(167, 139, 250, 0.55);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    gap: 7px;
    justify-content: center;
    padding: 9px 12px;
    width: 100%;
}

.edit-profile-button:hover {
    background: rgba(110, 69, 226, 0.35);
}

.account-preferences {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.78rem;
    line-height: 1.45;
    margin: 12px 0 0;
}

.profile-modal {
    align-items: center;
    background: rgba(0, 0, 0, 0.62);
    inset: 0;
    justify-content: center;
    padding: 20px;
    position: fixed;
    z-index: 100001;
}

.profile-modal-content {
    background: linear-gradient(145deg, rgba(48, 40, 72, 0.98), rgba(28, 28, 36, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
    max-width: 420px;
    padding: 22px;
    width: 100%;
}

.profile-modal-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}

.profile-modal-header h2 {
    font-size: 1.25rem;
    color: #a3a3a3;
}

.close-profile-modal {
    background: none;
    border: 0;
    color: #fff;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 3px;
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.profile-form label {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.82rem;
    margin-top: 4px;
}

.profile-form input {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    box-sizing: border-box;
    color: #fff;
    padding: 9px 10px;
    width: 100%;
}

.profile-form input:focus {
    border-color: #a78bfa;
    outline: none;
}

.profile-password-heading {
    color: #fff;
    font-size: 0.92rem;
    font-weight: 700;
    margin-top: 12px;
}

.profile-password-heading span {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.78rem;
    font-weight: 400;
}

.profile-password-field {
    position: relative;
}

.profile-password-field input {
    padding-right: 42px;
}

.profile-password-toggle {
    align-items: center;
    background: transparent;
    border: 0;
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    display: flex;
    height: 38px;
    justify-content: center;
    position: absolute;
    right: 2px;
    top: 0;
    width: 38px;
}

.profile-password-toggle:hover,
.profile-password-toggle:focus-visible {
    color: #fff;
}

.save-profile-button {
    align-items: center;
    background: #6e45e2;
    border: 0;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    gap: 7px;
    justify-content: center;
    margin-top: 9px;
    padding: 10px;
}

.settings-section h3 {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    color: #6E45E2;
}

.settings-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-option label {
    font-size: 14px;
}

.settings-select-option select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 7px;
    color: #fff;
    cursor: pointer;
    max-width: 150px;
    padding: 7px 9px;
}

.settings-select-option select option {
    background: #2b2b2b;
    color: #fff;
}

.settings-reset-button {
    align-items: center;
    background: transparent;
    border: 1px solid rgba(239, 116, 116, 0.45);
    border-radius: 8px;
    color: #f5a5a5;
    cursor: pointer;
    display: inline-flex;
    gap: 7px;
    justify-content: center;
    margin-top: 14px;
    padding: 9px 12px;
    width: 100%;
}

.settings-reset-button:hover,
.settings-reset-button:focus-visible {
    background: rgba(239, 116, 116, 0.12);
    color: #fff;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #6E45E2;
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

/* Settings Panel Overlay */
.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 99999;
    display: none;
}

.settings-overlay.active {
    display: block;
}

/* Dark Mode Styles */
body.dark-mode {
    background: linear-gradient(135deg, #0f0c1d, #1f1f1f);
}

body.dark-mode .chatbot-container {
    background: linear-gradient(135deg, #1a1a2e, #1f1f1f);
}

body.dark-mode .message-out {
    color: #dfdfdf;
    background-color: rgba(110, 69, 226, 0.2);
}

body.dark-mode .message-in {
    color: #dfdfdf;
    background-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode .input-row {
    background-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode #user-input {
    background-color: transparent;
    color: #fff;
}

body.dark-mode #send-button,
body.dark-mode #more-icon {
    color: #fff;
}

body.dark-mode .mini-option-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

body.dark-mode .mini-option-btn:hover {
    background: rgba(110, 69, 226, 0.3);
}

/* Animation Styles */
body.no-animations * {
    animation: none !important;
    transition: none !important;
}

/* Ensure messages are always visible regardless of animation state */
body.no-animations .message {
    opacity: 1 !important;
}

body.no-animations .message-in,
body.no-animations .message-out {
    transform: none !important;
}

/* Base message styles without animation dependency */
.message {
    opacity: 1;
}

.message-in, .message-out {
    opacity: 1;
}

/* Animation styles only applied when animations are enabled */
body:not(.no-animations) .message-in {
    animation: fadeInSlide 0.3s ease-out both;
}

body:not(.no-animations) .message-out {
    animation: bounceFade 0.5s ease-out both;
}

/* Message Timestamp and Word Count Styles */
.message-timestamp, .message-wordcount {
    display: none !important;
}

/* Remove timestamp toggle effects */
body:not(.show-timestamps) .message-timestamp,
body:not(.show-wordcount) .message-wordcount {
    display: none !important;
}

/* Compact Messages Mode */
.compact-messages .message {
    padding: 10px 15px;
    margin: 5px 0;
}

.compact-messages .message-in,
.compact-messages .message-out {
    margin: 5px 20px;
}

/* Syntax Highlighting Enhancements */
.syntax-highlighting .message-content pre {
    background: #282c34;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.syntax-highlighting .message-content code {
    font-family: 'Fira Code', 'Consolas', monospace;
    line-height: 1.5;
}

.dark-mode.syntax-highlighting .message-content pre {
    background: #1e2127;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Input Word Count Styles */
.input-word-count {
    position: absolute;
    right: 10px;
    bottom: 5px;
    font-size: 0.8rem;
    color: #666;
    pointer-events: none;
}

.input-word-count.limit-exceeded {
    color: #ff4444;
}

.close-popup-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 28px;
    cursor: pointer;
    color: #000000;
    transition: color 0.3s ease;
}

.close-popup-icon:hover {
    color: #d21717;
}

/* Chat History Popup Styles */
.chat-history-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(24, 24, 24, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100001;
    animation: fadein 0.3s;
}

.chat-history-popup-content {
    background: rgba(43, 43, 43, 0.98);
    backdrop-filter: blur(30px);
    border-radius: 22px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    padding: 32px 24px 24px 24px;
    min-width: 340px;
    max-width: 95vw;
    max-height: 80vh;
    width: 400px;
    color: #fff;
    position: relative;
    display: flex;
    flex-direction: column;
    animation: popup-entrance 0.4s cubic-bezier(.4,1.6,.6,1) both;
}

#close-history-popup {
    position: absolute;
    top: 18px;
    right: 18px;
    font-size: 2rem;
    color: #fff;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 2;
}
#close-history-popup:hover {
    color: #6E45E2;
}

.chat-history-list {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    max-height: 55vh;
    padding-right: 10px;
}

.chat-history-list::-webkit-scrollbar {
    width: 6px;
    display: block;
}

.chat-history-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.chat-history-list::-webkit-scrollbar-thumb {
    background: rgba(110, 69, 226, 0.5);
    border-radius: 3px;
}

.chat-history-list::-webkit-scrollbar-thumb:hover {
    background: rgba(110, 69, 226, 0.7);
}

.chat-history-item {
    background: rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 18px 18px 14px 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    position: relative;
    transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
    animation: fadeInSlide 0.4s;
}
.chat-history-item:hover {
    background: rgba(110, 69, 226, 0.13);
    box-shadow: 0 4px 16px rgba(110,69,226,0.10);
    transform: translateY(-2px) scale(1.01);
}
.chat-history-item .chat-date {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 0.85em;
    color: #bdbdbd;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    z-index: 1;
}
.chat-history-item .chat-preview {
    color: #fff;
    font-size: 1.08em;
    font-weight: 600;
    margin: 8px 0 6px 0;
    padding-right: 40px;
    word-break: break-word;
    opacity: 0.95;
}
.chat-history-item .chat-meta {
    font-size: 0.98em;
    color: #bdbdbd;
    margin-top: 2px;
    font-weight: 400;
}

body.dark-mode .chat-history-popup-content {
    background: rgba(30, 30, 40, 0.98);
    color: #fff;
}
body.dark-mode .chat-history-item {
    background: rgba(255,255,255,0.04);
    color: #fff;
}
body.dark-mode .chat-history-item:hover {
    background: rgba(110, 69, 226, 0.18);
}

.chat-history-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    z-index: 2;
}

.chat-history-delete {
    color: #ff4444;
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.7;
    transition: opacity 0.2s;
    margin-top: 1.2em;
    padding: 4px;
    background: rgba(255, 68, 68, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-history-delete:hover {
    opacity: 1;
    background: rgba(255, 68, 68, 0.2);
}

.clear-all-history {
    background: rgba(255, 68, 68, 0.1);
    color: #ff4444;
    border: 1px solid rgba(255, 68, 68, 0.3);
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 16px;
    transition: all 0.3s ease;
}

.clear-all-history:hover {
    background: rgba(255, 68, 68, 0.2);
    transform: translateY(-1px);
}

/* Keyboard Shortcuts Styles */
.shortcuts-list {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    overflow-y: auto;
    max-height: 60vh;
    padding: 4px 8px 8px 0;
}

.shortcut-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 12px 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.shortcut-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(110, 69, 226, 0.1), rgba(110, 69, 226, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.shortcut-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: rgba(110, 69, 226, 0.3);
}

.shortcut-item:hover::before {
    opacity: 1;
}

.shortcut-keys {
    display: flex;
    gap: 6px;
    align-items: center;
}

.shortcut-description {
    color: #fff;
    font-size: 0.95rem;
    opacity: 0.9;
    font-weight: 500;
    letter-spacing: 0.2px;
}

kbd {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-family: 'SF Mono', 'Consolas', monospace;
    line-height: 1;
    padding: 4px 8px;
    min-width: 24px;
    height: 24px;
    text-align: center;
    transition: all 0.2s ease;
}

kbd:hover {
    background: rgba(255,255,255,0.12);
    transform: translateY(-1px);
}

/* Update popup content for keyboard shortcuts */
#shortcuts-popup .chat-history-popup-content {
    max-width: 800px;
    width: 50%;
    padding: 28px 24px 24px 24px;
    background: rgba(78, 76, 90, 0.253);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);    
    border: 1px solid rgba(255,255,255,0.1);
}

#shortcuts-popup h2 {
    font-size: 1.4rem;
    margin-bottom: 8px;
    color: #fff;
    opacity: 0.95;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.5px;
}

/* Dark mode enhancements */
body.dark-mode .shortcut-item {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.06);
}

body.dark-mode .shortcut-item:hover {
    background: rgba(110, 69, 226, 0.12);
    border-color: rgba(110, 69, 226, 0.4);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .shortcuts-list {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-top: 12px;
    }

    .shortcut-item {
        padding: 10px 14px;
    }

    kbd {
        font-size: 0.8rem;
        padding: 3px 6px;
        min-width: 22px;
        height: 22px;
    }

    .shortcut-description {
        font-size: 0.9rem;
    }

    #shortcuts-popup .chat-history-popup-content {
        padding: 24px 20px 20px 20px;
        width: 50%;
    }

    #shortcuts-popup h2 {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .shortcuts-list {
        gap: 6px;
        margin-top: 10px;
    }

    .shortcut-item {
        padding: 8px 12px;
    }

    kbd {
        font-size: 0.75rem;
        padding: 2px 5px;
        min-width: 20px;
        height: 20px;
    }

    .shortcut-description {
        font-size: 0.85rem;
    }

    #shortcuts-popup .chat-history-popup-content {
        padding: 20px 16px 16px 16px;
        width: 50%;
    }

    #shortcuts-popup h2 {
        font-size: 1.2rem;
    }
}

