:root {
    /* Dark Theme - Default */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --accent-blue: #3b82f6;
    --accent-blue-light: #60a5fa;
    --accent-blue-dark: #2563eb;
    --gradient-start: #1e40af;
    --gradient-end: #3b82f6;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --glass-bg: rgba(30, 58, 138, 0.15);
    --glass-border: rgba(59, 130, 246, 0.25);
    --shadow-glow: rgba(59, 130, 246, 0.4);
    --shadow-glow-light: rgba(255, 255, 255, 0.1);
    --card-bg: rgba(30, 58, 138, 0.2);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f1f5f9;
    --bg-tertiary: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #1e293b;
    --text-muted: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(59, 130, 246, 0.35);
    --shadow-glow: rgba(0, 0, 0, 0.1);
    --shadow-glow-light: rgba(59, 130, 246, 0.2);
    --card-bg: rgba(255, 255, 255, 0.85);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
    font-size: clamp(0.875rem, 0.8rem + 0.4vw, 1rem);
}

/* Navbar - Enhanced Frosted Glass Effect */
.navbar {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 1100px;
    z-index: 10000; /* Above backdrop (9998) and menu (9999) to ensure visibility */
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    border: 1px solid var(--glass-border);
    padding: 1rem 0;
    transition: var(--transition);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1),
                0 0 20px rgba(59, 130, 246, 0.1);
    border-radius: 20px;
    overflow: visible;
}

[data-theme="light"] .navbar {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
}

.navbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(59, 130, 246, 0.5) 50%, 
        transparent 100%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1001;
    overflow: visible;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-blue-light);
}

.logo-icon {
    width: 28px;
    height: 28px;
    color: var(--accent-blue-light);
    stroke-width: 2;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
    align-items: center;
    position: relative;
    z-index: 1001;
    overflow: visible;
}

/* Desktop - keep menu visible and ensure proper display */
@media (min-width: 768px) {
    .nav-menu {
        display: flex !important;
        position: relative !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        pointer-events: auto !important;
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        width: auto !important;
        max-width: none !important;
        max-height: none !important;
        overflow: visible !important;
        flex-direction: row !important;
        gap: 2rem !important;
        border-radius: 0 !important;
    }
    
    /* Ensure desktop menu is always visible regardless of mobile-open class */
    .nav-menu.mobile-open,
    .nav-menu:not(.mobile-open) {
        display: flex !important;
        position: relative !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        pointer-events: auto !important;
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        width: auto !important;
        max-width: none !important;
        max-height: none !important;
        overflow: visible !important;
        flex-direction: row !important;
        gap: 2rem !important;
        border-radius: 0 !important;
        z-index: 1001 !important;
    }
    
    .menu-toggle {
        display: none !important;
    }
}

.nav-menu li {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-icon {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.nav-link::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: var(--accent-blue);
    opacity: 0;
    transition: var(--transition);
    z-index: -1;
}

.nav-link:hover::before,
.nav-link.active::before {
    opacity: 0.15;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-blue-light);
    text-shadow: 0 0 10px var(--shadow-glow);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
    border-radius: 2px;
    box-shadow: 0 0 10px var(--shadow-glow);
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.install-btn {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-dark));
    border: 1px solid var(--glass-border);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 2px 10px var(--shadow-glow);
}

.install-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--shadow-glow);
}

.theme-toggle {
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 0.75rem;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-icon {
    width: 24px;
    height: 24px;
    stroke-width: 2;
    transition: transform 0.3s ease, opacity 0.3s ease;
    color: var(--text-primary);
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px var(--shadow-glow);
    background: var(--accent-blue);
}

.theme-toggle:hover .theme-icon {
    color: white;
    transform: rotate(15deg);
}

.theme-toggle[data-theme="light"] .theme-icon {
    transform: rotate(0deg);
}

.theme-toggle[data-theme="dark"] .theme-icon {
    transform: rotate(0deg);
}

.menu-toggle {
    display: none; /* Hidden on desktop, shown on mobile */
    flex-direction: column;
    gap: 5px;
    padding: 0.75rem;
    background: rgba(59, 130, 246, 0.1);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1002;
    outline: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1), 0 0 10px rgba(59, 130, 246, 0.2);
}

/* Force menu toggle visible on mobile */
@media (max-width: 767px) {
    .menu-toggle {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
}

.menu-toggle:focus {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

.menu-toggle:active {
    transform: scale(0.95);
}

/* Before clicking - Hamburger icon (3 horizontal bars) */
.menu-bar {
    width: 24px;
    height: 2.5px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
    display: block;
}

/* After clicking - Transform hamburger to X icon */
.menu-toggle.active .menu-bar:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
    background: var(--text-primary);
}

.menu-toggle.active .menu-bar:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.menu-toggle.active .menu-bar:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
    background: var(--text-primary);
}

.menu-toggle:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15), 0 0 20px rgba(59, 130, 246, 0.3);
}

.menu-toggle:hover .menu-bar {
    background: var(--accent-blue);
}

.menu-toggle.active {
    background: rgba(59, 130, 246, 0.25);
}

.menu-toggle.active:hover .menu-bar {
    background: var(--text-primary);
}

/* Sections */
.section {
    min-height: 100vh;
    padding: 100px 2rem 4rem;
    max-width: 1200px;
    margin: 0 auto;
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

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

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--accent-blue-light), var(--accent-blue), var(--accent-blue-dark));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    font-weight: 700;
}

.section-title-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: center;
}

.section-icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.section-icon svg {
    width: 100%;
    height: 100%;
}

.section-header p {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* Hero Section */
.hero {
    position: relative;
    text-align: center;
    padding: 4rem 0;
    margin-bottom: 4rem;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    animation: fadeInUp 0.8s ease;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-blue-light), var(--accent-blue), #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(10deg); }
}

.hero-description {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.8;
    animation: fadeInUp 0.8s ease 0.2s backwards;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-blue) 0%, transparent 70%);
    opacity: 0.3;
    filter: blur(80px);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
}

/* Buttons */
.btn {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-dark));
    color: white;
    box-shadow: 0 4px 15px var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-glow);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--accent-blue-light);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: var(--accent-blue);
    color: white;
    transform: translateY(-2px);
}

.btn-share {
    background: #25D366;
    color: white;
}

.btn-share:hover {
    background: #20ba5a;
    transform: translateY(-2px);
}

.btn-close {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Lab Grid */
.lab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.lab-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s ease backwards;
    z-index: 1;
}

.lab-card:nth-child(1) { animation-delay: 0.1s; }
.lab-card:nth-child(2) { animation-delay: 0.2s; }
.lab-card:nth-child(3) { animation-delay: 0.3s; }
.lab-card:nth-child(4) { animation-delay: 0.4s; }

.lab-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 40px var(--shadow-glow), 
                0 0 20px var(--shadow-glow-light);
    border-color: var(--accent-blue);
}

.lab-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: linear-gradient(135deg, 
        rgba(59, 130, 246, 0.1) 0%, 
        transparent 50%);
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
}

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

.card-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-icon svg {
    width: 100%;
    height: 100%;
}

.lab-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--accent-blue-light);
}

.lab-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Search Bar */
.search-bar {
    display: flex;
    gap: 1rem;
    max-width: 600px;
    margin: 2rem auto;
}

.search-input {
    flex: 1;
    padding: 1rem 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--shadow-glow);
}

.search-btn {
    padding: 1rem 1.5rem;
    background: var(--accent-blue);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn i {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

.search-btn:hover {
    background: var(--accent-blue-dark);
    transform: scale(1.05);
}

/* Category Filter */
.lab-category-filter {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 25px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    font-weight: 500;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

/* Labs Container */
.labs-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.lab-item {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.5s ease backwards;
}

.lab-item:nth-child(1) { animation-delay: 0.1s; }
.lab-item:nth-child(2) { animation-delay: 0.2s; }
.lab-item:nth-child(3) { animation-delay: 0.3s; }
.lab-item:nth-child(4) { animation-delay: 0.4s; }

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

.lab-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 30px var(--shadow-glow),
                0 0 15px var(--shadow-glow-light);
    border-color: var(--accent-blue);
}

.lab-item h4 {
    color: var(--accent-blue-light);
    margin-bottom: 0.5rem;
}

.lab-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    max-width: 90vw;
    max-height: 90vh;
    width: 1000px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: var(--accent-blue-light);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-tertiary);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.lab-iframe-container {
    width: 100%;
    height: 500px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    border: 1px solid var(--glass-border);
    position: relative;
    background: var(--bg-secondary);
}

.lab-iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.lab-iframe-container::before {
    content: 'Loading simulation...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-muted);
    display: none;
    z-index: 1;
}

.lab-iframe-container iframe[src=""] ~ .lab-iframe-container::before,
.lab-iframe-container:empty::before {
    display: block;
}

.lab-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ICT Tools */
.ict-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.ict-tool-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.ict-tool-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px var(--shadow-glow);
    border-color: var(--accent-blue);
}

.tool-logo {
    width: 72px;
    height: 72px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-logo svg {
    width: 100%;
    height: 100%;
}

.ict-tool-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--accent-blue-light);
}

.ict-iframe-container {
    margin-top: 2rem;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    min-height: 600px;
}

.ict-tool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

#ictIframeWrapper {
    width: 100%;
    height: 600px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    position: relative;
}

.ict-iframe-fade {
    animation: fadeIn 0.5s ease;
}

#ictIframeWrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
    opacity: 0;
    animation: fadeIn 0.5s ease 0.2s forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Chat Interface */
.chat-container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--card-bg);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 650px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3),
                0 0 40px rgba(59, 130, 246, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.chat-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--glass-border);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(99, 102, 241, 0.05));
    display: flex;
    align-items: center;
    gap: 1rem;
}

.chat-header-icon {
    width: 32px;
    height: 32px;
    color: var(--accent-blue-light);
    stroke-width: 2;
}

.chat-header h3 {
    margin: 0;
    color: var(--accent-blue-light);
    font-size: 1.25rem;
    font-weight: 600;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--accent-blue);
    border-radius: 4px;
    opacity: 0.5;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    opacity: 0.8;
}

.message {
    display: flex;
    gap: 0.75rem;
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    align-items: flex-start;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 600;
    font-size: 0.875rem;
}

.bot-message .message-avatar {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-dark));
    color: white;
}

.user-message {
    justify-content: flex-end;
}

.user-message .message-avatar {
    background: linear-gradient(135deg, var(--accent-blue-light), var(--accent-blue));
    color: white;
    order: 2;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message-content {
    max-width: 75%;
    padding: 1rem 1.25rem;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
    line-height: 1.6;
}

.bot-message .message-content {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.user-message .message-content {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-dark));
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.message-content p {
    margin: 0;
    font-size: 0.95rem;
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.6;
    margin-top: 0.5rem;
    display: block;
}

.chat-input-container {
    display: flex;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--glass-border);
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.05), transparent);
}

.chat-input {
    flex: 1;
    padding: 1rem 1.5rem;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 2px solid var(--glass-border);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    resize: none;
    min-height: 50px;
    max-height: 120px;
}

.chat-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2),
                0 4px 12px rgba(59, 130, 246, 0.15);
    background: var(--bg-tertiary);
    transform: translateY(-2px);
}

.chat-input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.chat-send-btn {
    border-radius: 20px;
    padding: 1rem 2rem;
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.chat-send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.chat-send-btn:active {
    transform: translateY(0);
}

.chat-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.loading-indicator {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    padding: 0.5rem 0;
}

.loading-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-blue);
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* About Section */
.about-container {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.about-text {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 3rem;
}

.features-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-item {
    padding: 2rem;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    transition: var(--transition);
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--shadow-glow);
}

.feature-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    color: var(--accent-blue-light);
    stroke-width: 1.5;
}

.btn-icon {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.feature-item h4 {
    color: var(--accent-blue-light);
    margin-bottom: 0.5rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    border-top: 1px solid var(--glass-border);
    margin-top: 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.install-btn-footer {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-dark));
    border: 1px solid var(--glass-border);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 2px 10px var(--shadow-glow);
}

.install-btn-footer:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--shadow-glow);
}

/* Quiz Styles */
.quiz-question {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
}

.quiz-question h4 {
    color: var(--accent-blue-light);
    margin-bottom: 1rem;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.quiz-option {
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.quiz-option:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

/* ========== RESPONSIVE DESIGN - COMPREHENSIVE OPTIMIZATION ========== */

/* Large Desktop (1440px and above) */
@media (min-width: 1440px) {
    .navbar {
        max-width: 1400px;
    }
    
    .section {
        max-width: 1400px;
    }
    
    .nav-container {
        max-width: 1400px;
    }
}

/* Desktop (1024px - 1439px) */
@media (min-width: 1024px) and (max-width: 1439px) {
    .navbar {
        max-width: 1200px;
    }
}

/* Tablet Landscape (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .navbar {
        width: 96%;
        max-width: 1000px;
        padding: 0.875rem 0;
    }
    
    .nav-container {
        padding: 0 1.5rem;
    }
    
    /* Desktop menu - keep normal display */
    .nav-menu {
        display: flex !important;
        gap: 1.5rem;
        position: relative !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        pointer-events: auto !important;
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        width: auto !important;
        max-width: none !important;
        max-height: none !important;
        overflow: visible !important;
        flex-direction: row !important;
        border-radius: 0 !important;
    }
    
    .section {
        padding: 90px 1.5rem 3rem;
    }
    
    .lab-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .ict-tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .hero-title {
        font-size: clamp(2rem, 5vw, 3rem);
    }
    
    .hero-description {
        font-size: clamp(0.95rem, 2vw, 1.125rem);
    }
    
    .chat-container {
        height: 600px;
        max-width: 800px;
    }
    
    .modal-content {
        max-width: 90vw;
        padding: 1.5rem;
    }
}

/* Tablet Portrait & Mobile Landscape (481px - 767px) */
@media (max-width: 767px) {
    .navbar {
        top: 0.5rem;
        width: 98%;
        max-width: none;
        border-radius: 16px;
        padding: 0.75rem 0;
    }
    
    .nav-container {
        padding: 0 1rem;
    }
    
    .logo {
        font-size: 1.1rem;
    }
    
    .logo-icon {
        width: 24px;
        height: 24px;
    }
    
    .card-icon {
        width: 54px;
        height: 54px;
    }
    
    /* Show menu toggle on mobile - FORCE VISIBILITY */
    .menu-toggle {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        cursor: pointer !important;
        position: relative !important;
        z-index: 10002 !important; /* Above everything to ensure accessibility */
        background: rgba(59, 130, 246, 0.2) !important;
    }
    
    /* Mobile menu - hide by default, show when .mobile-open */
    .nav-menu {
        position: fixed !important;
        top: 80px !important;
        left: 1rem !important;
        right: 1rem !important;
        width: calc(100% - 2rem) !important;
        max-width: calc(100% - 2rem) !important;
        flex-direction: column !important;
        /* Glassmorphism effect - frosted glass - LESS TRANSPARENT */
        background: rgba(15, 23, 42, 0.95) !important;
        backdrop-filter: blur(25px) saturate(200%) !important;
        -webkit-backdrop-filter: blur(25px) saturate(200%) !important;
        border: 1px solid rgba(255, 255, 255, 0.15) !important;
        border-radius: 24px !important;
        padding: 1.5rem !important;
        gap: 0.5rem !important;
        z-index: 9999 !important; /* Above backdrop (9998) but below navbar (10000) */
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6),
                    0 0 40px rgba(59, 130, 246, 0.4),
                    inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
        max-height: calc(100vh - 120px) !important;
        overflow-y: auto !important;
        margin: 0 !important;
        transform: translateY(-20px) scale(0.95) !important;
        transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                    visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }
    
    /* Show menu when mobile-open class is added - smooth fade/slide animation */
    .nav-menu.mobile-open {
        display: flex !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: translateY(0) scale(1) !important;
        background: rgba(15, 23, 42, 0.95) !important;
    }
    
    /* Ensure menu is hidden when not mobile-open */
    .nav-menu:not(.mobile-open) {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    /* Light theme glassmorphism - LESS TRANSPARENT */
    [data-theme="light"] .nav-menu {
        background: rgba(255, 255, 255, 0.95) !important;
        border: 1px solid rgba(0, 0, 0, 0.15) !important;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4),
                    0 0 40px rgba(59, 130, 246, 0.3),
                    inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
    }

    [data-theme="light"] .nav-menu.mobile-open {
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3),
                    0 0 40px rgba(59, 130, 246, 0.2),
                    inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
    }
    
    /* Prevent body scroll when menu is open */
    body.no-scroll {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
        height: 100% !important;
    }
    
    /* Backdrop overlay with blur effect when menu is open */
    body.no-scroll::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(15px) saturate(150%);
        -webkit-backdrop-filter: blur(15px) saturate(150%);
        z-index: 9998;
        pointer-events: none;
        animation: fadeInBackdrop 0.3s ease;
    }
    
    [data-theme="light"] body.no-scroll::before {
        background: rgba(0, 0, 0, 0.4);
    }
    
    @keyframes fadeInBackdrop {
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
        }
    }
    
    .nav-menu li {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        list-style: none !important;
        display: block !important;
    }
    
    .nav-menu .nav-link {
        background: rgba(59, 130, 246, 0.1) !important;
        border: 1px solid rgba(59, 130, 246, 0.2) !important;
        margin-bottom: 0.5rem !important;
        padding: 1rem !important;
        min-height: 48px !important; /* Touch target */
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        width: 100% !important;
        color: var(--text-primary) !important;
        text-decoration: none !important;
        border-radius: 12px !important;
        transition: all 0.3s ease !important;
    }
    
    .nav-menu .nav-link:hover,
    .nav-menu .nav-link.active {
        background: var(--accent-blue) !important;
        border-color: var(--accent-blue) !important;
        color: white !important;
        transform: translateX(5px) !important;
    }
    
    .nav-menu .nav-link:hover .nav-icon,
    .nav-menu .nav-link.active .nav-icon {
        color: white !important;
    }
    
    .nav-menu .nav-link span {
        display: inline-block !important;
        margin-left: 0.5rem !important;
    }
    
    .nav-menu .nav-link .nav-icon {
        display: inline-block !important;
        width: 18px !important;
        height: 18px !important;
        flex-shrink: 0 !important;
    }

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

    .menu-toggle {
        display: flex !important;
        min-width: 44px;
        min-height: 44px;
        width: 44px;
        height: 44px;
        z-index: 1002;
        position: relative;
    }
    
    /* Menu toggle visibility handled above */

    .theme-toggle {
        min-width: 44px;
        min-height: 44px;
        padding: 0.625rem;
    }

    .section {
        padding: 80px 1rem 3rem;
        min-height: calc(100vh - 80px);
    }

    .section-header h2 {
        font-size: clamp(1.75rem, 6vw, 2.25rem);
    }
    
    .section-header p {
        font-size: clamp(0.9rem, 2.5vw, 1.05rem);
    }

    .hero-title {
        font-size: clamp(2rem, 8vw, 2.75rem);
        line-height: 1.2;
    }

    .hero-description {
        font-size: clamp(0.95rem, 3vw, 1.1rem);
        line-height: 1.6;
    }

    .hero-buttons {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .lab-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .ict-tools-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .lab-category-filter {
        flex-wrap: wrap;
        gap: 0.75rem;
        justify-content: center;
    }
    
    .filter-btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
        min-height: 44px; /* Touch target */
    }

    .search-bar {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-input {
        width: 100%;
        min-height: 48px; /* Touch target */
        padding: 0.875rem 1.25rem;
    }
    
    .search-btn {
        width: 100%;
        min-height: 48px;
        justify-content: center;
    }

    .modal-content {
        max-width: 95vw;
        max-height: 95vh;
        margin: 1rem;
        padding: 1.25rem;
        border-radius: 16px;
    }

    .modal-header {
        padding: 1rem 1.25rem;
    }

    .modal-body {
        padding: 1.25rem;
    }

    .lab-iframe-container,
    #ictIframeWrapper {
        height: 400px;
        border-radius: 12px;
    }

    .chat-container {
        height: 550px;
        border-radius: 20px;
        margin: 0 1rem;
    }
    
    .chat-header {
        padding: 1rem 1.25rem;
    }
    
    .chat-messages {
        padding: 1rem;
    }
    
    .chat-input-container {
        padding: 1rem 1.25rem;
        flex-wrap: wrap;
    }
    
    .chat-input {
        min-height: 48px;
        padding: 0.875rem 1.25rem;
    }
    
    .chat-send-btn {
        min-width: 90px;
        min-height: 48px;
        padding: 0.875rem 1.5rem;
    }
    
    .message-content {
        max-width: 85%;
        padding: 0.875rem 1.125rem;
    }

    .lab-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .btn {
        min-height: 48px; /* Touch target */
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }
    
    .lab-item {
        padding: 1.25rem;
        min-height: 120px;
    }
    
    .ict-tool-card {
        padding: 1.5rem;
        min-height: 180px;
    }
    
    .feature-item {
        padding: 1.5rem;
    }
    
    .about-container {
        padding: 0 1rem;
    }
    
    .features-list {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Small Mobile (320px - 480px) */
@media (max-width: 480px) {
    .navbar {
        top: 0.25rem;
        width: 99%;
        padding: 0.625rem 0;
    }
    
    .nav-container {
        padding: 0 0.75rem;
    }
    
    .logo {
        font-size: 1rem;
        gap: 0.5rem;
    }
    
    .logo-text {
        display: none; /* Hide logo text on very small screens */
    }
    
    .logo-icon {
        width: 28px;
        height: 28px;
    }

    .hero-title {
        font-size: clamp(1.75rem, 9vw, 2.25rem);
        margin-bottom: 1rem;
    }

    .hero-description {
        font-size: clamp(0.875rem, 3.5vw, 1rem);
        margin-bottom: 1.5rem;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }

    .section {
        padding: 70px 0.75rem 2rem;
    }
    
    .section-header {
        margin-bottom: 2rem;
    }
    
    .section-header h2 {
        font-size: clamp(1.5rem, 7vw, 2rem);
    }

    .btn {
        width: 100%;
        font-size: 0.9rem;
    }
    
    .btn-icon {
        width: 18px;
        height: 18px;
    }

    .search-bar {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .search-input {
        font-size: 0.95rem;
    }

    .lab-category-filter {
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.625rem 1rem;
        font-size: 0.85rem;
        flex: 1;
        min-width: auto;
    }

    .modal-content {
        max-width: 98vw;
        margin: 0.5rem;
        padding: 1rem;
        border-radius: 12px;
    }
    
    .modal-header h3 {
        font-size: 1.25rem;
    }
    
    .modal-close {
        width: 36px;
        height: 36px;
        font-size: 1.5rem;
    }

    .lab-iframe-container,
    #ictIframeWrapper {
        height: 350px;
        border-radius: 10px;
    }

    .chat-container {
        height: 500px;
        margin: 0 0.5rem;
        border-radius: 16px;
    }
    
    .chat-header {
        padding: 0.875rem 1rem;
    }
    
    .chat-header h3 {
        font-size: 1.1rem;
    }
    
    .chat-messages {
        padding: 0.875rem;
        gap: 1rem;
    }
    
    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }
    
    .message-content {
        max-width: 90%;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .chat-input-container {
        padding: 0.875rem 1rem;
    }
    
    .chat-input {
        font-size: 0.95rem;
        padding: 0.75rem 1rem;
    }
    
    .chat-send-btn {
        min-width: 80px;
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }
    
    .chat-send-btn span {
        display: none; /* Hide text, show icon only */
    }

    .lab-actions {
        flex-direction: column;
        gap: 0.625rem;
    }
    
    .lab-item {
        padding: 1rem;
        min-height: 110px;
    }
    
    .lab-item h4 {
        font-size: 1rem;
    }
    
    .lab-item p {
        font-size: 0.85rem;
    }
    
    .ict-tool-card {
        padding: 1.25rem;
        min-height: 160px;
    }
    
    .ict-tool-card h3 {
        font-size: 1.25rem;
    }
    
    .tool-logo {
        width: 56px;
        height: 56px;
    }
    
    .feature-item {
        padding: 1.25rem;
    }
    
    .features-list {
        gap: 1.25rem;
    }
    
    .about-text {
        font-size: 0.95rem;
        line-height: 1.7;
    }
    
    /* Ensure touch targets are at least 44x44px */
    * {
        -webkit-tap-highlight-color: rgba(59, 130, 246, 0.2);
    }
    
    button, 
    a, 
    input[type="button"], 
    input[type="submit"],
    .lab-item,
    .ict-tool-card {
        touch-action: manipulation;
    }
}

/* Extra Small Mobile (max-width: 360px) */
@media (max-width: 360px) {
    .navbar {
        padding: 0.5rem 0;
    }
    
    .section {
        padding: 65px 0.5rem 1.5rem;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .filter-btn {
        font-size: 0.8rem;
        padding: 0.5rem 0.875rem;
    }
    
    .chat-container {
        height: 450px;
    }
    
    .lab-iframe-container,
    #ictIframeWrapper {
        height: 300px;
    }
}

/* Landscape Orientation */
@media (max-height: 500px) and (orientation: landscape) {
    .navbar {
        top: 0.25rem;
        padding: 0.5rem 0;
    }
    
    .section {
        padding-top: 60px;
        min-height: auto;
    }
    
    .chat-container {
        height: calc(100vh - 120px);
        max-height: 400px;
    }
    
    .lab-iframe-container,
    #ictIframeWrapper {
        height: 300px;
    }
    
    .modal-content {
        max-height: 90vh;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .menu-toggle,
    .theme-toggle,
    .install-btn,
    .chat-input-container,
    .lab-actions {
        display: none;
    }
    
    .section {
        display: block !important;
        page-break-inside: avoid;
    }
}

/* Loading Spinner */
.loader {
    border: 4px solid var(--glass-border);
    border-top: 4px solid var(--accent-blue);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========== FLOATING AI TUTOR CHAT ========== */
.floating-chat-bubble {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.4),
                0 4px 16px rgba(0, 0, 0, 0.15),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001; /* Above navbar (10000) and menu (9999) to ensure always accessible */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: floatBubble 3s ease-in-out infinite;
    overflow: visible;
}

@keyframes floatBubble {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

.floating-chat-bubble:hover {
    transform: translateY(-6px) scale(1.1);
    box-shadow: 0 12px 40px rgba(59, 130, 246, 0.5),
                0 6px 20px rgba(0, 0, 0, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.floating-chat-bubble.active {
    transform: scale(0.9);
    opacity: 0.8;
    animation: none;
}

.chat-bubble-icon {
    width: 32px;
    height: 32px;
    color: white;
    stroke-width: 2;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
    z-index: 2;
    position: relative;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.floating-chat-bubble:hover .chat-bubble-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}


.chat-bubble-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--accent-blue);
    animation: pulse 2s ease-in-out infinite;
    opacity: 0.5;
    z-index: 1;
}

.chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.2rem 0.35rem;
    border-radius: 10px;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4),
                0 0 10px rgba(16, 185, 129, 0.3);
    z-index: 3;
    letter-spacing: 0.3px;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.3);
        opacity: 0;
    }
}

.floating-chat-panel {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 380px;
    max-width: calc(100vw - 4rem);
    height: 600px;
    max-height: calc(100vh - 120px); /* Account for navbar height */
    background: var(--card-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3),
                0 0 40px rgba(59, 130, 246, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 10001; /* Above navbar (10000) and menu (9999) to ensure always accessible */
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.floating-chat-panel.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.floating-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(30, 58, 138, 0.1) 100%);
}

.floating-chat-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.floating-chat-icon {
    width: 24px;
    height: 24px;
    color: var(--accent-blue);
    stroke-width: 2;
}

.floating-chat-title h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.floating-chat-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: rgba(59, 130, 246, 0.1);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.floating-chat-close:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: scale(1.1);
}

.floating-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
}

.floating-message {
    display: flex;
    gap: 0.75rem;
    animation: slideIn 0.3s ease;
}

.floating-message.user-message {
    justify-content: flex-end;
}

.floating-message-content {
    max-width: 75%;
    padding: 0.875rem 1rem;
    border-radius: 18px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.floating-message.user-message .floating-message-content {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-blue-dark) 100%);
    color: white;
    border-color: var(--accent-blue);
}

.floating-message.bot-message .floating-message-content {
    background: var(--card-bg);
    color: var(--text-primary);
}

.floating-message-content p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.floating-chat-input-container {
    display: flex;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--glass-border);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(30, 58, 138, 0.05) 100%);
}

.floating-chat-input {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: 2px solid var(--glass-border);
    border-radius: 20px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.floating-chat-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.floating-chat-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-blue-dark) 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.floating-chat-send:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.floating-chat-send:active {
    transform: scale(0.95);
}

/* Mobile responsive for floating chat */
@media (max-width: 768px) {
    .floating-chat-bubble {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 56px;
        height: 56px;
        z-index: 10001 !important; /* Ensure always visible above menu */
    }
    
    .chat-bubble-icon {
        width: 28px;
        height: 28px;
    }
    
    .chat-badge {
        font-size: 0.6rem;
        padding: 0.2rem 0.35rem;
        top: -3px;
        right: -3px;
    }
    
    .floating-chat-panel {
        bottom: 1.5rem;
        right: 1.5rem;
        left: 1.5rem;
        width: auto;
        height: calc(100vh - 140px); /* Account for navbar and spacing */
        max-height: calc(100vh - 140px);
        top: auto;
        z-index: 10001 !important; /* Ensure always visible above menu */
    }
}

/* Ensure chat panel doesn't overlap navbar on small screens */
@media (max-width: 767px) {
    .floating-chat-panel {
        max-height: calc(100vh - 100px); /* Ensure clear space for navbar */
    }
}
