/* ================= GENERAL RESET ================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: #0A0717;
    color: white;
    overflow-x: hidden;
}

/* ================= NAVBAR BUTTON VISIBILITY ================= */
.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

#signupBtn {
    display: flex;
}

#homepageProfileBtn {
    display: none;
    align-items: center;
    justify-content: center;
}

body.logged-in #signupBtn {
    display: none !important;
}

body.logged-in #homepageProfileBtn {
    display: flex !important;
}

body.logged-in #signinBtn {
    display: none !important;
}

/* ================= NAVBAR ================= */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 7, 23, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 50px;
    z-index: 1000;
    border-bottom: 1px solid rgba(168, 85, 247, 0.15);
}

.logo img {
    width: 160px;
}

.navbar nav {
    display: flex;
    gap: 30px;
    align-items: center;
}

.navbar nav a {
    color: #e0e0e0;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: 0.3s;
    padding: 8px 0;
    position: relative;
}

.navbar nav a:hover {
    color: #a855f7;
}

.navbar nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #a855f7, #6366f1);
    transition: 0.3s;
    transform: translateX(-50%);
}

.navbar nav a:hover::after {
    width: 100%;
}

.nav-btn {
    background: linear-gradient(90deg, #a855f7, #6366f1);
    border: none;
    padding: 10px 24px;
    border-radius: 40px;
    cursor: pointer;
    color: white;
    font-size: 14px;
    font-weight: 600;
    transition: 0.3s;
}

.nav-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
}

.profile-icon {
    background: rgba(168, 85, 247, 0.2);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
}

.profile-icon:hover {
    background: linear-gradient(90deg, #a855f7, #6366f1);
    transform: scale(1.05);
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
}

.profile-icon svg {
    width: 20px;
    height: 20px;
    stroke: white;
}

/* ================= HERO SECTION ================= */
.hero {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: radial-gradient(circle at 30% 40%, #1a162b, #0A0717);
    padding: 0 20px;
}

.hero-content {
    max-width: 800px;
    animation: fadeInUp 0.8s ease;
}

.hero h1 {
    font-size: 64px;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.2;
    background: linear-gradient(135deg, #ffffff, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero span {
    background: linear-gradient(135deg, #a855f7, #6366f1);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p {
    font-size: 18px;
    color: #cbd5f5;
    margin-bottom: 35px;
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-btn {
    padding: 14px 36px;
    font-size: 16px;
    border: none;
    border-radius: 50px;
    background: linear-gradient(90deg, #a855f7, #6366f1);
    color: white;
    cursor: pointer;
    transition: 0.3s;
    font-weight: 600;
    box-shadow: 0 5px 20px rgba(168, 85, 247, 0.3);
}

.hero-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(168, 85, 247, 0.5);
}

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

/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        min-width: 320px !important;
    }

    .navbar {
        flex-direction: column;
        padding: 15px 20px;
        position: relative !important;
    }

    .navbar nav {
        margin: 15px 0;
        flex-wrap: wrap !important;
        justify-content: center !important;
    }

    .navbar nav a {
        font-size: 14px !important;
        padding: 8px 12px !important;
        margin: 2px !important;
    }

    .nav-right {
        margin-top: 15px !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 10px !important;
    }

    .hero h1 {
        font-size: 28px !important;
        line-height: 1.2 !important;
        margin-bottom: 15px !important;
    }

    .hero p {
        font-size: 16px !important;
        margin-bottom: 25px !important;
        line-height: 1.5 !important;
    }

    .features-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        padding: 0 15px !important;
    }

    .feature-card {
        padding: 20px !important;
        margin-bottom: 15px !important;
    }
    
    .hero-btn, .nav-btn, .profile-icon {
        touch-action: manipulation !important;
        -webkit-tap-highlight-color: transparent !important;
        user-select: none !important;
        pointer-events: auto !important;
        cursor: pointer !important;
        position: relative !important;
        z-index: 10 !important;
        display: inline-block !important;
        text-decoration: none !important;
    }

    .hero-btn {
        min-height: 48px !important;
        min-width: 140px !important;
        font-size: 16px !important;
        padding: 14px 28px !important;
        border-radius: 25px !important;
        background: linear-gradient(90deg, #a855f7, #6366f1) !important;
        border: none !important;
        color: white !important;
        text-align: center !important;
        transition: all 0.3s ease !important;
        box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3) !important;
        margin: 10px auto !important;
        display: block !important;
    }

    .hero-btn:hover, .hero-btn:active {
        transform: translateY(-2px) !important;
        box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4) !important;
    }

    .nav-btn, .profile-icon {
        min-height: 44px !important;
        padding: 12px 20px !important;
        font-size: 14px !important;
        border-radius: 22px !important;
        background: linear-gradient(90deg, #a855f7, #6366f1) !important;
        border: none !important;
        color: white !important;
        text-align: center !important;
        transition: all 0.3s ease !important;
        display: inline-block !important;
    }

    .hero-content {
        text-align: center !important;
        padding: 30px 15px !important;
        max-width: 100% !important;
    }

    .hero {
        min-height: 70vh !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 60px 0 20px 0 !important;
    }

    section {
        padding: 60px 20px !important;
    }

    .logo img {
        width: 120px !important;
        height: auto !important;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 32px;
    }
    
    .navbar nav a {
        font-size: 13px;
    }
    
    .nav-btn {
        padding: 8px 20px;
        font-size: 12px;
    }
}

.section {
    padding: 100px 80px;
    text-align: center;
}

.section h2 {
    margin-bottom: 40px;
    font-size: 32px;
}

/* ================= FEATURE CARDS ================= */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.feature-card {
    background: rgba(20, 15, 40, 0.6);
    padding: 25px;
    border-radius: 15px;
    transition: all 0.3s ease;
    border: 1px solid rgba(168, 85, 247, 0.15);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(168,85,247,0.15), transparent);
    opacity: 0;
    transition: 0.3s;
}

.feature-card:hover {
    transform: translateY(-10px) scale(1.02);
    background: linear-gradient(135deg,#1a162b,#2a2445);
    border: 1px solid rgba(168, 85, 247, 0.4);
    box-shadow: 0 10px 30px rgba(168,85,247,0.2);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-card h3 {
    margin-bottom: 10px;
    transition: 0.3s;
}

.feature-card p {
    color: #cbd5f5;
    font-size: 14px;
    transition: 0.3s;
}

.feature-card:hover h3 {
    color: #a855f7;
}

.feature-card:hover p {
    color: #e5e7eb;
}

/* ================= ABOUT SECTION ================= */
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.about-card {
    background: rgba(20, 15, 40, 0.4);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid rgba(168, 85, 247, 0.1);
    transition: 0.3s;
}

.about-card:hover {
    transform: translateY(-5px);
    border-color: rgba(168, 85, 247, 0.3);
    background: rgba(168, 85, 247, 0.05);
}

.about-card h3 {
    color: #a855f7;
    margin-bottom: 15px;
}

.about-card p {
    color: #cbd5f5;
    line-height: 1.6;
}

#about p {
    max-width: 800px;
    margin: auto;
    line-height: 1.8;
    color: #d1d5db;
}

/* ================= CONTACT SECTION ================= */
#contact form {
    max-width: 500px;
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#contact input,
#contact textarea {
    padding: 12px 15px;
    border-radius: 10px;
    border: 1px solid rgba(168, 85, 247, 0.2);
    background: rgba(20, 15, 40, 0.6);
    color: white;
    outline: none;
    font-size: 14px;
    transition: 0.3s;
    backdrop-filter: blur(10px);
}

#contact input::placeholder,
#contact textarea::placeholder {
    color: #9ca3af;
}

#contact input:focus,
#contact textarea:focus {
    border: 1px solid #a855f7;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

#contact button {
    padding: 12px;
    border-radius: 25px;
    border: none;
    background: linear-gradient(90deg,#a855f7,#6366f1);
    color: white;
    cursor: pointer;
    transition: 0.3s;
}

#contact button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(168,85,247,0.3);
}

/* ================= BLOG SECTION ================= */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.blog-card {
    background: #1a162b;
    padding: 25px;
    border-radius: 15px;
    text-align: left;
    transition: 0.3s;
    border: 1px solid transparent;
}

.blog-card h3 {
    margin-bottom: 10px;
}

.blog-card p {
    color: #cbd5f5;
    font-size: 14px;
}

.blog-card:hover {
    transform: translateY(-8px);
    border: 1px solid #a855f7;
    background: linear-gradient(135deg,#1a162b,#2a2445);
}

/* ================= PROFILE PAGE STYLES ================= */
.profile-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.profile-card {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.avatar {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #a855f7;
    box-shadow: 0 8px 20px rgba(168, 85, 247, 0.3);
    transition: 0.3s;
    cursor: pointer;
}

.avatar:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

.details {
    background: rgba(20, 16, 32, 0.6);
    backdrop-filter: blur(8px);
    border-radius: 28px;
    padding: 1.8rem;
    border: 1px solid rgba(168, 85, 247, 0.2);
    margin-bottom: 1.5rem;
}

.detail-item {
    margin-bottom: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-item label {
    font-weight: 500;
    font-size: 0.85rem;
    color: #c084fc;
    letter-spacing: 0.5px;
}

.detail-item input,
.detail-item select {
    background: #0e0b18;
    border: 1px solid #2d2742;
    border-radius: 14px;
    padding: 12px 16px;
    color: white;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    transition: 0.2s;
}

.detail-item input:focus,
.detail-item select:focus {
    outline: none;
    border-color: #a855f7;
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.3);
}

.save-btn {
    background: linear-gradient(90deg, #a855f7, #6366f1);
    border: none;
    width: 100%;
    padding: 14px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 1rem;
    color: white;
    cursor: pointer;
    margin-bottom: 2rem;
    transition: 0.2s;
}

.save-btn:hover {
    transform: scale(0.98);
    box-shadow: 0 5px 15px rgba(168, 85, 247, 0.4);
}

.profile-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.profile-buttons button {
    background: rgba(30, 26, 47, 0.9);
    border: 1px solid rgba(168, 85, 247, 0.4);
    padding: 10px 18px;
    border-radius: 40px;
    color: white;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.profile-buttons button:hover {
    background: #a855f7;
    border-color: #a855f7;
    transform: translateY(-2px);
}

.back-home-btn {
    background: linear-gradient(90deg, #a855f7, #6366f1);
    border: none;
    padding: 12px 24px;
    border-radius: 40px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    width: 100%;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
}

.back-home-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(168, 85, 247, 0.4);
}

.back-home-btn:active {
    transform: translateY(0);
}

/* ================= PAGE CONTAINER ================= */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.page-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(168, 85, 247, 0.3);
    padding-bottom: 1rem;
}

.back-btn {
    background: rgba(168, 85, 247, 0.2);
    border: 1px solid rgba(168, 85, 247, 0.5);
    color: #c084fc;
    padding: 0.6rem 1.2rem;
    border-radius: 40px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.back-btn:hover {
    background: #a855f7;
    color: white;
    border-color: #a855f7;
    transform: translateX(-4px);
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #c084fc, #818cf8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.legal-content {
    background: rgba(20, 16, 32, 0.6);
    backdrop-filter: blur(8px);
    border-radius: 32px;
    padding: 2rem;
    border: 1px solid rgba(168, 85, 247, 0.2);
    line-height: 1.7;
}

.legal-content h2 {
    color: #c084fc;
    margin: 1.5rem 0 0.8rem 0;
    font-size: 1.6rem;
}

.legal-content h3 {
    color: #a78bfa;
    margin: 1.2rem 0 0.5rem;
    font-size: 1.2rem;
}

.legal-content p {
    margin-bottom: 1rem;
    color: #d1d5db;
}

.legal-content ul {
    margin: 1rem 0 1rem 2rem;
}

.legal-content li {
    margin-bottom: 0.5rem;
}

/* ================= TOAST MESSAGE ================= */
.toast-message {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(90deg, #22c55e, #16a34a);
    color: white;
    padding: 10px 24px;
    border-radius: 40px;
    font-weight: 500;
    z-index: 10000;
    animation: fadeSlide 3s ease forwards;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    font-family: 'Poppins', sans-serif;
}

@keyframes fadeSlide {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    15% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    85% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

/* ================= REGISTER/LOGIN PAGE ================= */
.register-page {
    background: radial-gradient(circle at center, #1a162b, #0A0717);
}

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.register-box,
.login-box {
    background: #1a162b;
    padding: 40px;
    border-radius: 15px;
    width: 420px;
    text-align: center;
    border: 1px solid #2a2445;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.register-box h2,
.login-box h2 {
    margin-bottom: 25px;
    font-size: 28px;
}

.register-box input,
.login-box input,
.register-box select,
.login-box select {
    text-align: left;
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border-radius: 8px;
    border: 1px solid #2a2445;
    background: #120d25;
    color: white;
    outline: none;
    transition: 0.3s;
}

.register-box input::placeholder,
.login-box input::placeholder {
    color: #9ca3af;
}

.register-box input:focus,
.login-box input:focus,
.register-box select:focus,
.login-box select:focus {
    border: 1px solid #a855f7;
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.3);
}

.register-box button,
.login-box button {
    width: 100%;
    padding: 12px;
    margin-top: 15px;
    border: none;
    border-radius: 25px;
    background: linear-gradient(90deg,#a855f7,#6366f1);
    color: white;
    cursor: pointer;
    transition: 0.3s;
}

.register-box button:hover,
.login-box button:hover {
    transform: scale(1.05);
}

.register-box p,
.login-box p {
    margin-top: 15px;
    font-size: 14px;
    color: #cbd5f5;
}

.register-box a,
.login-box a {
    color: #a855f7;
    text-decoration: none;
}

.register-box a:hover,
.login-box a:hover {
    text-decoration: underline;
}

@media (max-width: 500px) {
    .register-box,
    .login-box {
        width: 100%;
        padding: 30px 20px;
    }
}

/* ================= DASHBOARD LAYOUT ================= */
.dashboard-page {
    display: flex;
    min-height: 100vh;
    background: radial-gradient(circle at center, #1a162b, #0A0717);
    position: relative;
}

/* ================= LEFT SIDEBAR ================= */
.sidebar {
    width: 260px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: rgba(10, 7, 23, 0.98);
    backdrop-filter: blur(12px);
    border-right: 1px solid rgba(168, 85, 247, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Logo */
.sidebar .logo {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(168, 85, 247, 0.15);
    margin-bottom: 20px;
}

.sidebar .logo img {
    width: 140px;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 0 12px;
}

.sidebar-section {
    margin-bottom: 25px;
}

.section-title {
    font-size: 11px;
    font-weight: 600;
    color: #a1a1aa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 12px;
    margin-bottom: 8px;
}

/* Navigation Items */
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin: 4px 0;
    border-radius: 10px;
    color: #d1d1e0;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.nav-item:hover {
    background: rgba(168, 85, 247, 0.15);
    color: white;
    transform: translateX(4px);
}

.nav-item.active {
    background: rgba(168, 85, 247, 0.25);
    color: white;
    border-left: 2px solid #a855f7;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    flex-shrink: 0;
}

/* Logout Button */
.logout-section {
    padding: 20px 12px;
    border-top: 1px solid rgba(168, 85, 247, 0.15);
    margin-top: auto;
}

.logout-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(90deg, #ef4444, #dc2626);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(239, 68, 68, 0.4);
}

/* ================= RIGHT SIDEBAR ================= */
.right-sidebar {
    width: 280px;
    height: 100vh;
    position: fixed;
    top: 0;
    right: 0;
    background: rgba(20, 17, 34, 0.95);
    backdrop-filter: blur(12px);
    border-left: 1px solid rgba(168, 85, 247, 0.15);
    padding: 20px;
    overflow-y: auto;
    z-index: 1000;
}

.right-sidebar h3 {
    font-size: 12px;
    font-weight: 600;
    color: #a1a1aa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 20px 0 12px 8px;
}

.right-sidebar h3:first-child {
    margin-top: 0;
}

/* Chat Items */
.chat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    margin: 4px 0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    color: #e4e4e7;
}

.chat-item:hover {
    background: rgba(255, 255, 255, 0.07);
}

.chat-item.active {
    background: rgba(168, 85, 247, 0.15);
}

.chat-title {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Project Items */
.project-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    margin: 4px 0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
}

.project-item:hover {
    background: rgba(255, 255, 255, 0.07);
}

.project-title {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Three-dot Menu */
.chat-menu-container,
.project-menu-container {
    position: relative;
    margin-left: 8px;
}

.chat-menu-btn,
.project-menu-btn {
    background: transparent;
    border: none;
    color: #a1a1aa;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    opacity: 0;
    transition: all 0.2s ease;
}

.chat-item:hover .chat-menu-btn,
.project-item:hover .project-menu-btn {
    opacity: 1;
}

.chat-menu-btn:hover,
.project-menu-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

/* Dropdown Menus */
.chat-dropdown,
.project-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 8px;
    background: #2a2a3a;
    border-radius: 10px;
    width: 140px;
    z-index: 10000;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: none;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.chat-dropdown.show,
.project-dropdown.show {
    display: block;
    animation: dropdownFadeIn 0.2s ease;
}

.dropdown-item {
    padding: 10px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    transition: all 0.2s;
    color: #e4e4e7;
    background: #2a2a3a;
    border: none;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover {
    background: rgba(168, 85, 247, 0.2);
}

.dropdown-item.delete {
    color: #ef4444;
}

/* ================= MAIN CHAT AREA ================= */
.main {
    margin-left: 260px;
    margin-right: 280px;
    min-height: 100vh;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Chat Messages Container */
#searchResults {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    margin-bottom: 80px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Chat Bubbles */
.user-bubble {
    align-self: flex-end;
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    color: white;
    padding: 12px 18px;
    border-radius: 20px;
    border-bottom-right-radius: 4px;
    max-width: 80%;
    word-wrap: break-word;
}

.ai-bubble {
    align-self: flex-start;
    background: #2a1a4a;
    color: #e5e5e5;
    padding: 12px 18px;
    border-radius: 20px;
    border-bottom-left-radius: 4px;
    max-width: 80%;
    word-wrap: break-word;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

/* Search Box */
.search-box {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    max-width: 700px;
    z-index: 100;
}

.chat-input-box {
    display: flex;
    align-items: center;
    background: #1a162b;
    padding: 12px 20px;
    border-radius: 40px;
    gap: 10px;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.chat-input-box input {
    flex: 1;
    border: none;
    background: transparent;
    color: white;
    outline: none;
    font-size: 14px;
}

.chat-input-box input::placeholder {
    color: #6b7280;
}

.icon-btn {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
}

.send-btn {
    border: none;
    background: linear-gradient(90deg, #a855f7, #6366f1);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

/* Plus Button Dropdown */
.plus-dropdown-container {
    position: relative;
}

.plus-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #2a2445;
    color: white;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.2s ease;
}

.plus-btn:hover {
    background: linear-gradient(90deg, #a855f7, #6366f1);
    transform: scale(1.05);
}

.plus-dropdown {
    position: absolute;
    bottom: 50px;
    left: 0;
    background: #1a162b;
    border-radius: 12px;
    display: none;
    flex-direction: column;
    width: 180px;
    overflow: hidden;
    border: 1px solid rgba(168, 85, 247, 0.2);
    z-index: 1000;
}

.plus-dropdown.show {
    display: flex;
}

.plus-dropdown a {
    padding: 12px 16px;
    text-decoration: none;
    color: white;
    transition: 0.2s;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.plus-dropdown a:hover {
    background: linear-gradient(90deg, #a855f7, #6366f1);
}

/* ================= STUDY NOTES STYLES ================= */
.study-notes-container {
    background: rgba(20, 16, 32, 0.6);
    backdrop-filter: blur(8px);
    border-radius: 20px;
    padding: 25px;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.notes-header h3 {
    color: #a855f7;
    font-size: 20px;
}

.notes-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.note-btn {
    padding: 8px 16px;
    background: rgba(168, 85, 247, 0.2);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
}

.note-btn:hover {
    background: rgba(168, 85, 247, 0.4);
    transform: translateY(-2px);
}

.note-btn.primary {
    background: linear-gradient(90deg, #a855f7, #6366f1);
    border: none;
}

.notes-editor {
    margin-bottom: 25px;
}

#notesTitle {
    width: 100%;
    padding: 12px 15px;
    background: #120d25;
    border: 1px solid #2a2445;
    border-radius: 10px;
    color: white;
    font-size: 16px;
    margin-bottom: 15px;
}

#notesContent {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    background: #120d25;
    border: 1px solid #2a2445;
    border-radius: 10px;
    color: white;
    font-size: 14px;
    resize: vertical;
    font-family: 'Poppins', sans-serif;
}

.notes-list {
    max-height: 400px;
    overflow-y: auto;
}

.note-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.note-item:hover {
    background: rgba(168, 85, 247, 0.1);
    transform: translateX(5px);
}

.note-item.selected {
    border-left-color: #a855f7;
    background: rgba(168, 85, 247, 0.15);
}

.note-title {
    font-size: 16px;
    font-weight: 600;
    color: white;
    margin-bottom: 8px;
}

.note-preview {
    font-size: 12px;
    color: #a1a1aa;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.note-date {
    font-size: 10px;
    color: #6b7280;
}

.note-item-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.note-item-actions button {
    padding: 4px 12px;
    background: rgba(168, 85, 247, 0.2);
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 11px;
}

.note-item-actions button.delete-note {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* ================= LEARNING TOOLS STYLES ================= */
.learning-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.learning-tab-btn {
    padding: 10px 24px;
    background: transparent;
    border: none;
    color: #a1a1aa;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.learning-tab-btn.active {
    background: linear-gradient(90deg, #a855f7, #6366f1);
    color: white;
}

.learning-tab-btn:hover:not(.active) {
    background: rgba(168, 85, 247, 0.2);
    color: white;
}

/* Quiz Styles */
.quiz-container {
    padding: 20px;
}

.quiz-info-card {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(99, 102, 241, 0.05));
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.quiz-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
}

.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.1);
}

.badge.difficulty {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

.badge.questions {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.badge.marks {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.quiz-question-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.question-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.question-number {
    background: linear-gradient(135deg, #a855f7, #6366f1);
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
}

.question-text {
    flex: 1;
    font-weight: 500;
    font-size: 16px;
}

.question-marks {
    font-size: 12px;
    color: #fbbf24;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quiz-option:hover {
    background: rgba(168, 85, 247, 0.1);
    transform: translateX(5px);
}

.quiz-option.selected {
    background: rgba(168, 85, 247, 0.2);
    border-left: 3px solid #a855f7;
}

.quiz-option input {
    cursor: pointer;
}

.option-text {
    flex: 1;
    font-size: 14px;
}

.quiz-actions {
    display: flex;
    gap: 15px;
    margin: 25px 0 20px;
    justify-content: center;
}

.submit-quiz-btn {
    padding: 12px 30px;
    background: linear-gradient(90deg, #22c55e, #16a34a);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    cursor: pointer;
}

.reset-quiz-btn {
    padding: 12px 30px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    color: #ef4444;
    font-weight: 600;
    cursor: pointer;
}

/* Score Card */
.score-card {
    background: linear-gradient(135deg, #1a162b, #0A0717);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.score-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a855f7, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 15px auto;
}

.score-percentage {
    font-size: 24px;
    font-weight: bold;
    color: white;
}

/* Flashcard Styles */
.flashcard-container {
    padding: 20px;
    text-align: center;
}

.flashcard {
    width: 500px;
    height: 300px;
    perspective: 1000px;
    cursor: pointer;
    margin: 30px auto;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flashcard.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
}

.flashcard-front {
    background: linear-gradient(135deg, #a855f7, #6366f1);
    transform: rotateY(0deg);
}

.flashcard-back {
    background: #1e1e2f;
    transform: rotateY(180deg);
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.flashcard-content {
    font-size: 18px;
    line-height: 1.6;
}

.flashcard-hint {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 20px;
}

.flashcard-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.flashcard-nav button {
    padding: 10px 24px;
    background: rgba(168, 85, 247, 0.2);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 8px;
    color: white;
    cursor: pointer;
}

#flashcardCounter {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

/* Study Notes Tab Content */
.notes-tab-content {
    padding: 20px;
}

.notes-header-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* ================= MODAL STYLES ================= */
/* Document Chat Modal */
.document-indicator {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(90deg, #a855f7, #6366f1);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 100;
}

.upload-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20000;
}

.upload-modal {
    background: #1a162b;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    border: 1px solid #a855f7;
    min-width: 300px;
}

/* Audio Modal */
.audio-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(16px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20000;
}

.audio-modal {
    background: linear-gradient(145deg, #1e1a3a, #0a0717);
    border-radius: 40px;
    width: 560px;
    max-width: 92%;
    border: 1px solid rgba(168, 85, 247, 0.45);
    padding: 0;
    overflow: hidden;
}

.audio-modal-header {
    padding: 22px 28px;
    background: rgba(168, 85, 247, 0.08);
    border-bottom: 1px solid rgba(168, 85, 247, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.audio-modal-body {
    padding: 32px 28px;
}

.mic-button {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    border: none;
    cursor: pointer;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mic-button.listening {
    animation: micPulse 1.4s infinite;
}

@keyframes micPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.7); }
    70% { transform: scale(1.08); box-shadow: 0 0 0 22px rgba(168, 85, 247, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(168, 85, 247, 0); }
}

.input-group {
    display: flex;
    gap: 12px;
    margin: 20px 0;
}

.audio-input {
    flex: 1;
    padding: 14px 22px;
    background: rgba(20, 15, 38, 0.95);
    border: 1.5px solid rgba(168, 85, 247, 0.35);
    border-radius: 60px;
    color: white;
}

.send-audio-btn {
    padding: 14px 36px;
    background: linear-gradient(105deg, #a855f7, #6366f1);
    border: none;
    border-radius: 60px;
    color: white;
    cursor: pointer;
}

/* Video Modal */
.video-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 30000;
}

.video-modal {
    background: linear-gradient(135deg, #1a162b, #0A0717);
    border-radius: 24px;
    width: 900px;
    max-width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 25px;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.video-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 8px 20px;
    background: rgba(168, 85, 247, 0.2);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
}

.tab-btn.active {
    background: linear-gradient(90deg, #a855f7, #6366f1);
}

/* Report Modal */
.report-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 45000;
}

.report-modal {
    background: linear-gradient(135deg, #1a162b, #0A0717);
    border-radius: 24px;
    width: 900px;
    max-width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 25px;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.report-options {
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.include-options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.generate-report-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(90deg, #a855f7, #6366f1);
    border: none;
    border-radius: 40px;
    color: white;
    font-weight: 600;
    cursor: pointer;
}

/* Learning Tools Modal */
.learning-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50000;
}

.learning-modal {
    background: linear-gradient(135deg, #1a162b, #0A0717);
    border-radius: 24px;
    width: 900px;
    max-width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 25px;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

/* Games Modal */
.games-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200000;
}

.games-modal {
    background: linear-gradient(135deg, #1a162b, #0A0717);
    border-radius: 24px;
    width: 900px;
    max-width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 25px;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

/* Games Grid */
.games-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    padding: 20px;
}

.game-card-large {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(99, 102, 241, 0.1));
    border: 2px solid rgba(168, 85, 247, 0.3);
    border-radius: 24px;
    padding: 35px 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.game-card-large:hover {
    transform: translateY(-8px);
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(99, 102, 241, 0.2));
    border-color: rgba(168, 85, 247, 0.6);
}

.game-card-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.play-now-btn {
    background: linear-gradient(90deg, #a855f7, #6366f1);
    border: none;
    padding: 12px 24px;
    border-radius: 40px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
}

/* Game Header */
.game-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.current-game-title {
    font-size: 24px;
    color: #a855f7;
}

.back-to-games-btn {
    padding: 8px 16px;
    background: rgba(168, 85, 247, 0.2);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 30px;
    color: white;
    cursor: pointer;
}

.game-header-info {
    display: flex;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.08);
    padding: 15px 20px;
    border-radius: 16px;
    margin-bottom: 25px;
}

.game-question-large {
    font-size: 28px;
    text-align: center;
    padding: 40px;
    background: rgba(168, 85, 247, 0.1);
    border-radius: 20px;
    margin: 25px 0;
}

.game-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 25px 0;
}

.game-option-btn {
    padding: 18px 24px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 14px;
    color: white;
    cursor: pointer;
}

/* Memory Game */
.memory-grid-large {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin: 25px 0;
}

.memory-card-large {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 16px;
    cursor: pointer;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.4s;
}

.memory-card-large.flipped {
    transform: rotateY(180deg);
}

.memory-card-large .card-front,
.memory-card-large .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    font-size: 32px;
}

.memory-card-large .card-front {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.memory-card-large .card-back {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    transform: rotateY(180deg);
}

.memory-card-large.matched {
    opacity: 0.4;
    cursor: default;
}

/* Typing Game */
.typing-word-large {
    font-size: 56px;
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(99, 102, 241, 0.1));
    border-radius: 20px;
    margin: 25px 0;
    font-family: monospace;
    letter-spacing: 4px;
}

.game-input-large {
    width: 100%;
    padding: 18px 24px;
    font-size: 18px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 14px;
    color: white;
    text-align: center;
}

/* Scrambled Word Game */
.scrambled-word-large {
    font-size: 48px;
    text-align: center;
    letter-spacing: 16px;
    padding: 40px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(99, 102, 241, 0.1));
    border-radius: 20px;
    margin: 25px 0;
    font-family: monospace;
}

.game-hint-large {
    text-align: center;
    font-size: 16px;
    color: #fbbf24;
    margin: 15px 0;
}

/* True/False Game */
.truefalse-buttons-large {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 30px 0;
}

.true-btn-large, .false-btn-large {
    flex: 1;
    padding: 18px 30px;
    font-size: 20px;
    font-weight: bold;
    border: none;
    border-radius: 60px;
    cursor: pointer;
}

.true-btn-large {
    background: linear-gradient(90deg, #10b981, #059669);
    color: white;
}

.false-btn-large {
    background: linear-gradient(90deg, #ef4444, #dc2626);
    color: white;
}

/* Game Results */
.game-results-large {
    text-align: center;
    padding: 50px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 24px;
}

.results-emoji {
    font-size: 72px;
}

.final-score-large {
    font-size: 36px;
    font-weight: bold;
    margin: 15px 0;
}

.score-percentage-large {
    font-size: 28px;
    color: #fbbf24;
    margin: 10px 0;
}

.results-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.play-again-btn {
    padding: 12px 24px;
    background: linear-gradient(90deg, #a855f7, #6366f1);
    border: none;
    border-radius: 40px;
    color: white;
    cursor: pointer;
}

/* Toast Message */
.toast-message {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(90deg, #22c55e, #16a34a);
    color: white;
    padding: 12px 24px;
    border-radius: 40px;
    font-weight: 500;
    z-index: 100000;
    animation: fadeSlide 3s ease forwards;
}

/* ================= ANIMATIONS ================= */
@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeSlide {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    15% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    85% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

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

/* ================= SCROLLBAR STYLES ================= */
*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

*::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

*::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.5);
    border-radius: 3px;
}

*::-webkit-scrollbar-thumb:hover {
    background: rgba(168, 85, 247, 0.8);
}

/* ================= RESPONSIVE DESIGN ================= */
@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }
    .main {
        margin-left: 220px;
        margin-right: 260px;
    }
    .right-sidebar {
        width: 260px;
    }
    .flashcard {
        width: 400px;
        height: 260px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 2000;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .right-sidebar {
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }
    
    .right-sidebar.open {
        transform: translateX(0);
    }
    
    .main {
        margin-left: 0;
        margin-right: 0;
    }
    
    .search-box {
        width: 90%;
    }
    
    .games-grid-container {
        grid-template-columns: 1fr;
    }
    
    .flashcard {
        width: 90%;
        height: 220px;
    }
    
    .memory-grid-large {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .typing-word-large {
        font-size: 32px;
    }
    
    .scrambled-word-large {
        font-size: 28px;
        letter-spacing: 8px;
    }
}

@media (max-width: 480px) {
    .chat-input-box {
        padding: 8px 12px;
    }
    
    .user-bubble, .ai-bubble {
        max-width: 95%;
    }
    
    .audio-modal, .video-modal, .report-modal, .learning-modal, .games-modal {
        width: 95%;
        padding: 15px;
    }
    
    .game-card-large {
        padding: 25px 20px;
    }
    
    .game-card-icon {
        font-size: 48px;
    }
    
    .memory-grid-large {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .truefalse-buttons-large {
        flex-direction: column;
    }
    
    .notes-header {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ================= HELPER CLASSES ================= */
.hidden {
    display: none !important;
}

.text-purple {
    color: #a855f7;
}

.bg-gradient {
    background: linear-gradient(90deg, #a855f7, #6366f1);
}

.rounded-full {
    border-radius: 9999px;
}

/* ================= LOADING STATES ================= */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #a855f7;
    animation: spin 0.6s linear infinite;
}

/* ================= BUTTON STYLES ================= */
button {
    cursor: pointer;
    transition: all 0.3s ease;
}

button:active {
    transform: scale(0.98);
}

/* ================= INPUT STYLES ================= */
input, textarea, select {
    font-family: 'Poppins', sans-serif;
}

input:focus, textarea:focus, select:focus {
    outline: none;
}

/* ================= PROGRESS BAR ================= */
.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #a855f7, #6366f1);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-status {
    margin-top: 8px;
    font-size: 12px;
    color: #a1a1aa;
    text-align: center;
}
/* ================= MODAL FIXES - ENSURE PROPER DISPLAY ================= */

/* Fix for all modals - ensure they display correctly */
.audio-modal-overlay,
.video-modal-overlay,
.report-modal-overlay,
.learning-modal-overlay,
.games-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    display: none !important;  /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

/* When modal is shown, override display */
.audio-modal-overlay[style*="display: flex"],
.video-modal-overlay[style*="display: flex"],
.report-modal-overlay[style*="display: flex"],
.learning-modal-overlay[style*="display: flex"],
.games-modal-overlay[style*="display: flex"] {
    display: flex !important;
}

/* Modal containers */
.audio-modal,
.video-modal,
.report-modal,
.learning-modal,
.games-modal {
    background: linear-gradient(135deg, #1a162b, #0A0717);
    border-radius: 24px;
    border: 1px solid rgba(168, 85, 247, 0.3);
    box-shadow: 0 0 40px rgba(168, 85, 247, 0.2);
    position: relative;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Fix for video modal specifically */
.video-modal {
    width: 900px;
    max-width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 25px;
}

/* Fix for audio modal */
.audio-modal {
    width: 560px;
    max-width: 92%;
    overflow: hidden;
}

/* Fix for report modal */
.report-modal {
    width: 900px;
    max-width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 25px;
}

/* Fix for learning modal */
.learning-modal {
    width: 900px;
    max-width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 25px;
}

/* Fix for games modal */
.games-modal {
    width: 900px;
    max-width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 25px;
}

/* Ensure modal headers are visible */
.audio-modal-header,
.video-modal-header,
.report-modal-header,
.learning-modal-header,
.games-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(168, 85, 247, 0.2);
}

.audio-modal-header h2,
.video-modal-header h2,
.report-modal-header h2,
.learning-modal-header h2,
.games-modal-header h2 {
    color: #a855f7;
    font-size: 24px;
    margin: 0;
}

.close-audio-modal,
.close-video-modal,
.close-report-modal,
.close-learning-modal,
.close-games-modal {
    background: rgba(168, 85, 247, 0.2);
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-audio-modal:hover,
.close-video-modal:hover,
.close-report-modal:hover,
.close-learning-modal:hover,
.close-games-modal:hover {
    background: #ef4444;
    transform: scale(1.1);
}

/* Ensure modal body content is visible */
.audio-modal-body,
.video-modal-body,
.report-modal-body,
.learning-modal-body,
.games-modal-body {
    padding: 20px;
    color: white;
}

/* Fix for games container */
#gameContent {
    min-height: 400px;
    padding: 20px;
}

/* Ensure games grid shows properly */
.games-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    padding: 20px;
}

/* Debug border - remove after fixing */
.audio-modal-overlay *,
.video-modal-overlay *,
.report-modal-overlay *,
.learning-modal-overlay *,
.games-modal-overlay * {
    /* visibility: visible; */
}