/* --- ChemAI Professional Laboratory Styles --- */

/* Responsive Breakpoints */
:root {
    /* Breakpoint variables */
    --bp-sm: 640px;  /* Small devices */
    --bp-md: 768px;  /* Medium devices */
    --bp-lg: 1024px; /* Large devices */
    --bp-xl: 1280px; /* Extra large devices */
    --bp-2xl: 1536px; /* 2XL devices */
    /* Professional Chemistry Color Palette */
    --primary-color: #00B4D8; /* Professional blue */
    --primary-dark: #0077B6; /* Darker blue for contrast */
    --secondary-color: #FF6B35; /* Accent orange */
    --accent-blue: #48CAE4; /* Light blue */
    --accent-purple: #7209B7; /* Professional purple */
    --success-green: #06FFA5; /* Success green */
    --warning-yellow: #FFD60A; /* Warning yellow */
    
    /* Professional Background Gradients */
    --background-primary: #0A1929; /* Deep professional blue */
    --background-secondary: #132F4C; /* Secondary background */
    --background-tertiary: #173A5E; /* Tertiary background */
    --surface-color: #1E3A8A; /* Surface color */
    
    /* Text Colors */
    --text-primary: #F8FAFC;
    --text-secondary: #CBD5E1;
    --text-muted: #94A3B8;
    --text-inverse: #0F172A;
    
    /* Professional Glass Effects */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-hover: rgba(255, 255, 255, 0.08);
    
    /* Typography */
    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    
    /* Professional Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);
    
    /* Professional Glows */
    --glow-primary: 0 0 20px rgba(0, 180, 216, 0.3);
    --glow-secondary: 0 0 20px rgba(255, 107, 53, 0.3);
    
    /* Spacing System */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
}

/* --- CSS Custom Properties for Animations --- */
@property --rotate {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

@property --molecule-rotate {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

/* --- Responsive Utilities --- */
.container {
    width: 100%;
    margin-right: auto;
    margin-left: auto;
    padding-right: 1rem;
    padding-left: 1rem;
}

/* Container responsive widths */
@media (min-width: 640px) {
    .container {
        max-width: 640px;
        padding-right: 1.5rem;
        padding-left: 1.5rem;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 768px;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 1024px;
        padding-right: 2rem;
        padding-left: 2rem;
    }
}

@media (min-width: 1280px) {
    .container {
        max-width: 1280px;
    }
}

/* Responsive Grid System */
.grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 640px) {
    .grid-cols-sm-2 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
    .grid-cols-md-3 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
    .grid-cols-lg-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Responsive Typography */
:root {
    --h1-size-mobile: 2rem;
    --h1-size-tablet: 2.5rem;
    --h1-size-desktop: 3rem;
    --h2-size-mobile: 1.75rem;
    --h2-size-tablet: 2rem;
    --h2-size-desktop: 2.25rem;
    --body-size-mobile: 0.875rem;
    --body-size-desktop: 1rem;
}

/* Responsive Spacing */
:root {
    --section-spacing-mobile: 2rem;
    --section-spacing-tablet: 3rem;
    --section-spacing-desktop: 4rem;
}

/* --- Global Reset and Base Styles --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    font-weight: 400;
    color: var(--text-primary);
    background: 
        radial-gradient(circle at 20% 50%, rgba(0, 180, 216, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 107, 53, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(114, 9, 183, 0.08) 0%, transparent 50%),
        linear-gradient(135deg, var(--background-primary) 0%, var(--background-secondary) 50%, var(--background-tertiary) 100%);
    background-attachment: fixed;
    overflow-x: hidden;
    min-height: 100vh;
}

/* --- Professional Container System --- */
.container {
    width: min(95%, 1200px);
    margin: 0 auto;
    padding: 0 var(--space-lg);
    position: relative;
    z-index: 5;
}

@media (max-width: 768px) {
    .container {
        width: 100%;
        padding: 0 var(--space-md);
    }
}

/* --- Professional Typography System --- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.025em;
    color: var(--text-primary);
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: var(--space-lg);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-blue) 50%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--space-2xl);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -0.75rem;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

h3 {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    font-weight: 600;
    margin-bottom: var(--space-md);
}

p {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

/* --- Professional Scroll Reveal Animations --- */
.reveal {
    opacity: 0;
    transform: translateY(40px) scale(0.98);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }

/* --- Professional Header --- */
header {
    background: #fff;
    box-shadow: none;
    border-bottom: 1.5px solid #e0e7ef;
    padding: 0;
    min-height: 64px;
    display: flex;
    align-items: center;
}

header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    padding-top: 0;
    padding-bottom: 0;
}

.logo {
    display: flex;
    align-items: center;
    padding: 0;
    height: 64px;
}

.site-logo {
    height: 48px;
    width: auto;
    display: block;
    padding: 0;
    margin: 0 0.5rem 0 0;
}

nav ul {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    margin: 0;
}

nav a {
    color: #1e293b;
    font-weight: 500;
    font-size: 1.08rem;
    opacity: 1;
    transition: color 0.2s, opacity 0.2s;
}

nav a.active, nav a:focus, nav a:hover {
    color: #00B4D8;
    opacity: 1;
}

/* --- Professional Button System --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    min-height: 48px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--text-inverse);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--glow-primary);
}

.btn-secondary {
    background: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
}

.btn-secondary::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-blue) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: var(--radius-lg);
    z-index: -1;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.btn-secondary:hover::after {
    opacity: 0.1;
}

/* --- Professional Hero Section --- */
.hero {
    padding: var(--space-3xl) 0 var(--space-2xl) 0;
    position: relative;
    overflow: hidden;
    margin-bottom: var(--space-2xl);
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 20%, rgba(0, 180, 216, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(255, 107, 53, 0.1) 0%, transparent 50%);
    animation: chemistry-flow 20s ease-in-out infinite;
    z-index: 1;
}

@keyframes chemistry-flow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    align-items: center;
    position: relative;
    z-index: 2;
    margin-bottom: var(--space-xl);
}

.hero-text h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: var(--space-lg);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-blue) 50%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: text-glow 3s ease-in-out infinite;
}

@keyframes text-glow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.1); }
}

.hero-text p {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}

.hero-buttons {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

/* --- Professional Chemistry Visual --- */
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.chemistry-container {
    position: relative;
    width: 400px;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.molecule {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-inverse);
    animation: float 6s ease-in-out infinite;
    box-shadow: var(--shadow-md);
}

.molecule::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-blue));
    z-index: -1;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.molecule.carbon {
    background: linear-gradient(135deg, #374151, #6B7280);
    top: 20%;
    left: 20%;
    animation-delay: 0s;
}

.molecule.oxygen {
    background: linear-gradient(135deg, #DC2626, #EF4444);
    top: 20%;
    right: 20%;
    animation-delay: 1.5s;
}

.molecule.hydrogen {
    background: linear-gradient(135deg, #059669, #10B981);
    bottom: 20%;
    left: 20%;
    animation-delay: 3s;
}

.molecule.nitrogen {
    background: linear-gradient(135deg, #7C3AED, #A855F7);
    bottom: 20%;
    right: 20%;
    animation-delay: 4.5s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

.bond {
    position: absolute;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-blue));
    border-radius: 2px;
    animation: bond-pulse 3s ease-in-out infinite;
}

@keyframes bond-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* --- Professional Chat Interface --- */
.chat-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    max-width: 600px;
    margin: 2rem auto 4rem auto;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
}

/* Minimized styles */
.chat-container.minimized {
    max-height: 60px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.chat-container.minimized .chat-messages,
.chat-container.minimized .chat-input-container {
    display: none !important;
}

.chat-container.minimized .chat-header {
    cursor: pointer;
}

/* Prevent minimize in fullscreen mode */
.chat-container.fullscreen.minimized {
    max-height: none;
    overflow: visible;
}

.chat-container.fullscreen.minimized .chat-messages,
.chat-container.fullscreen.minimized .chat-input-container {
    display: flex !important;
}

/* Fullscreen styles */
.chat-container.fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    border-radius: 0 !important;
    z-index: 9999 !important;
    display: flex !important;
    flex-direction: column !important;
    margin: 0 !important;
    overflow: hidden !important;
    background: white !important;
    box-shadow: none !important;
    border: none !important;
    transform: none !important;
}

.chat-container.fullscreen .chat-header {
    border-radius: 0 !important;
    flex-shrink: 0 !important;
    min-height: 80px !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.chat-container.fullscreen .chat-messages {
    flex: 1 !important;
    height: 0 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.chat-container.fullscreen .chat-input-container {
    border-radius: 0;
    flex-shrink: 0;
    min-height: 100px;
    background: white !important;
    border-top: 1px solid #e5e7eb;
    padding: 1.5rem;
    display: flex !important;
    align-items: center;
    z-index: 10;
    position: relative;
}

.chat-container.fullscreen .chat-form {
    width: 100%;
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.chat-container.fullscreen .chat-form input {
    background: white !important;
    border: 2px solid #e5e7eb;
    color: #1f2937;
    z-index: 11;
}

/* Body styles when chat is fullscreen */
body.chat-fullscreen-active {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
    background: white !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 1 !important;
}

/* Ensure html element is also clean */
body.chat-fullscreen-active html {
    overflow: hidden !important;
    background: white !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Hide page content but preserve chat container */
body.chat-fullscreen-active .hero-content > *:not(.chat-container),
body.chat-fullscreen-active .features,
body.chat-fullscreen-active .tools,
body.chat-fullscreen-active .cta,
body.chat-fullscreen-active footer,
body.chat-fullscreen-active header {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Ensure chat container is properly positioned and visible */
body.chat-fullscreen-active .chat-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    background: white !important;
}



.chat-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.chat-title {
    text-align: left;
}

.chat-header-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fullscreen-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 0.5rem;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.fullscreen-btn:active {
    transform: scale(0.95);
}

.fullscreen-btn svg {
    transition: all 0.3s ease;
}

.fullscreen-btn:hover svg {
    transform: scale(1.1);
}

.chat-header h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.chat-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.95rem;
}

.chat-messages {
    height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.5rem;
    background: #f8fafc;
    scroll-behavior: smooth;
}

.message {
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.bot-message {
    justify-content: flex-start;
}

.user-message {
    justify-content: flex-end;
}

.message-content {
    background: white;
    padding: 1rem 1.25rem;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 80%;
    border: 1px solid #e5e7eb;
}

.bot-message .message-content {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: white;
    border: none;
}

.user-message .message-content {
    background: #f3f4f6;
    color: #1f2937;
}

/* Markdown / content formatting inside messages */
.message-content .message-body { line-height: 1.6; }
.message-content .message-body p { margin: 0 0 0.75rem 0; }
.message-content .message-body p:last-child { margin-bottom: 0; }
.message-content > p { margin: 0 0 0.75rem 0; line-height: 1.5; }
.message-content > p:last-child { margin-bottom: 0; }
.message-content .message-body ul,
.message-content .message-body ol { margin: 0.5rem 0 0.75rem; padding-left: 1.25rem; }
.message-content .message-body li { margin: 0.25rem 0; }
.message-content > ul,
.message-content > ol { margin: 0.5rem 0; padding-left: 1.25rem; }
.message-content > li { margin-bottom: 0.25rem; }
.message-content .message-body h1,
.message-content .message-body h2,
.message-content .message-body h3 { margin: 0.5rem 0 0.5rem; line-height: 1.3; }
.message-content .message-body h4,
.message-content .message-body h5,
.message-content .message-body h6 { margin: 0.5rem 0 0.25rem; line-height: 1.3; }
.message-content .message-body pre { background: rgba(15,23,42,0.9); color: #e5e7eb; padding: 0.75rem; border-radius: 10px; overflow-x: auto; margin: 0.5rem 0; }
.message-content .message-body code { background: rgba(148,163,184,0.2); padding: 0.1rem 0.3rem; border-radius: 6px; }
.message-content .message-body pre code { background: transparent; padding: 0; }
.message-content .message-body blockquote { margin: 0.5rem 0; padding: 0.5rem 0.75rem; border-left: 4px solid #93c5fd; background: rgba(59,130,246,0.08); border-radius: 6px; }
.message-content .message-body hr { border: none; border-top: 1px solid #e5e7eb; margin: 0.75rem 0; }
.message-content .message-body a { color: #2563eb; text-decoration: underline; word-break: break-word; }
.bot-message .message-content .message-body a { color: #bfdbfe; }

/* LaTeX and MathJax Styles for Chemistry Content */
.message-content .MathJax {
    font-size: 1.1em;
    margin: var(--space-sm) 0;
}

.message-content .MathJax_Display {
    margin: var(--space-md) 0;
    text-align: center;
}

.message-content .MathJax_Display .MathJax {
    font-size: 1.2em;
}

/* Chemical formula styling */
.message-content .chemical-formula {
    font-family: var(--font-mono);
    background: rgba(0, 180, 216, 0.1);
    padding: 0.2em 0.4em;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0, 180, 216, 0.2);
}

/* Reaction arrow styling */
.message-content .reaction-arrow {
    color: var(--secondary-color);
    font-weight: bold;
    margin: 0 0.5em;
}

/* Enhanced LaTeX display for chemical equations */
.message-content .chemical-equation {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin: var(--space-md) 0;
    text-align: center;
}

.message-content .chemical-equation .MathJax {
    font-size: 1.3em;
}

/* Inline chemical formulas */
.message-content .inline-formula {
    font-family: var(--font-mono);
    color: var(--accent-blue);
    font-weight: 500;
}

/* Mathematical expressions */
.message-content .math-expression {
    background: rgba(114, 9, 183, 0.1);
    border: 1px solid rgba(114, 9, 183, 0.2);
    border-radius: var(--radius-sm);
    padding: 0.2em 0.4em;
    margin: 0 0.2em;
}

/* Units styling */
.message-content .unit {
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.9em;
}

/* --- Image Crop Modal --- */
.crop-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: none; align-items: center; justify-content: center; z-index: 2000; }
.crop-modal.show { display: flex; }
.crop-dialog { background: #fff; width: min(92vw, 900px); max-height: 90vh; display: flex; flex-direction: column; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.2); overflow: hidden; }
.crop-header { padding: 0.75rem 1rem; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e5e7eb; }
.crop-body { padding: 0; display: flex; align-items: center; justify-content: center; background: #111827; }
.crop-body img { max-width: 100%; display: block; }
.crop-footer { padding: 0.75rem 1rem; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #e5e7eb; gap: 0.5rem; }
.crop-btn { background: #f3f4f6; color: #111827; border: 1px solid #e5e7eb; padding: 0.5rem 0.75rem; border-radius: 8px; cursor: pointer; }
.crop-btn.primary { background: #2563eb; color: #fff; border-color: #1d4ed8; }
.crop-close-btn { background: transparent; border: none; font-size: 1.5rem; cursor: pointer; line-height: 1; color: #6b7280; }

.typing-indicator {
    display: flex;
    gap: 0.25rem;
    padding: 1rem 1.25rem;
    background: white;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 80px;
    border: 1px solid #e5e7eb;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #6b7280;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.chat-input-container {
    padding: 1.5rem;
    background: white;
    border-top: 1px solid #e5e7eb;
    position: relative;
    z-index: 1;
}

.chat-form {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    position: relative;
}

.input-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.control-btn {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #3b82f6;
}

.control-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: scale(1.05);
}

.control-btn:active {
    transform: scale(0.95);
}

.control-btn.recording {
    background: #ef4444;
    color: white;
    animation: pulse-red 1.5s infinite;
}

/* Camera button icon alignment */
.camera-btn svg { display: block; }

@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
}

.minimize-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
}

.minimize-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.minimize-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.minimize-btn:disabled:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: none;
}

.chat-form input {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: 2px solid #e5e7eb;
    border-radius: 25px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: #f9fafb;
}

.chat-form input:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.chat-form button {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.chat-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.chat-form button:active {
    transform: translateY(0);
}

.chat-form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.input-status {
    margin-top: 0.75rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.recording-dots {
    display: flex;
    gap: 0.25rem;
}

.recording-dots span {
    width: 6px;
    height: 6px;
    background: #ef4444;
    border-radius: 50%;
    animation: recording-pulse 1.4s infinite;
}

.recording-dots span:nth-child(1) { animation-delay: 0s; }
.recording-dots span:nth-child(2) { animation-delay: 0.2s; }
.recording-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes recording-pulse {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1); }
}

.upload-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
}

.tts-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: rgba(255, 255, 255, 0.8);
}

.tts-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.tts-btn.playing {
    background: rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.uploaded-image {
    margin: 0.5rem 0;
    text-align: center;
}

.uploaded-image img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.uploaded-image p {
    margin-top: 0.5rem;
    font-style: italic;
    color: #6b7280;
}

/* --- Professional Features Section --- */
.features, .tools {
    padding: var(--space-3xl) 0;
    position: relative;
    margin-top: var(--space-2xl);
}

.features {
    background: var(--background-secondary);
    position: relative;
    z-index: 5;
    clear: both;
}

.tools {
    background: var(--background-tertiary);
}

.feature-grid, .tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-xl);
    margin-top: var(--space-2xl);
}

.feature-card, .tool-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.feature-card::before, .tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-blue));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feature-card::after, .tool-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(0, 180, 216, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.feature-card:hover, .tool-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.feature-card:hover::before, .tool-card:hover::before {
    opacity: 1;
}

.feature-card:hover::after, .tool-card:hover::after {
    opacity: 1;
}

.feature-icon, .tool-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, var(--primary-color), var(--accent-blue));
    color: var(--text-inverse);
    font-size: 2rem;
    position: relative;
    animation: icon-pulse 3s ease-in-out infinite;
}

@keyframes icon-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 180, 216, 0.4); }
    50% { box-shadow: 0 0 0 20px rgba(0, 180, 216, 0); }
}

.feature-card h3, .tool-card h3 {
    margin-bottom: var(--space-md);
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 600;
}

.feature-card p, .tool-card p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
}

/* --- Professional CTA Section --- */
.cta {
    padding: var(--space-3xl) 0;
    background: linear-gradient(135deg, var(--background-tertiary) 0%, var(--background-secondary) 100%);
    text-align: center;
    position: relative;
}

.cta-content h2 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    margin-bottom: var(--space-lg);
}

.cta-content p {
    font-size: 1.125rem;
    margin-bottom: var(--space-xl);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* --- Professional Footer --- */
footer {
    background: var(--background-primary);
    color: var(--text-secondary);
    padding: var(--space-3xl) 0 var(--space-lg);
    border-top: 1px solid var(--glass-border);
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.footer-section h4 {
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    font-size: 1.125rem;
    font-weight: 600;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: var(--space-sm);
}

.footer-section ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--space-lg);
    border-top: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* --- Professional Loading Animation --- */
.loading-molecule {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-molecule.show {
    opacity: 1;
}

/* --- Professional Mobile Navigation --- */
#hamburger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
    z-index: 1002;
    flex-direction: column;
    gap: 4px;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

#hamburger-btn:hover {
    background: var(--glass-hover);
}

.hamburger-line {
    width: 24px;
    height: 2px;
    background-color: var(--primary-color, #00B4D8); /* visible on white header */
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}

#hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

#hamburger-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

#hamburger-btn.active .hamburger-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* --- Professional Responsive Design --- */
@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: var(--space-2xl);
        text-align: center;
    }
    
    .hero-text h1 {
        text-align: center;
    }
    
    .chemistry-container {
        width: 300px;
        height: 300px;
    }
    
    .feature-grid, .tool-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    /* Mobile Navigation */
    #hamburger-btn {
        display: flex;
    }

    /* Changed: Restrict slide-in styles to #main-nav only to avoid affecting mobile overlay navs */
    nav#main-nav {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        background: rgba(10, 25, 41, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        display: flex;
        align-items: center;
        justify-content: center;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        z-index: 1001;
    }

    nav#main-nav.active {
        transform: translateX(0);
    }

    /* Ensure our mobile overlay content is visible and not translated off-screen */
    #mobile-nav .mobile-nav-content {
        position: static !important;
        transform: none !important;
        width: auto;
        height: auto;
    }

    nav ul {
        flex-direction: column;
        gap: var(--space-lg);
        text-align: center;
    }

    nav a {
        font-size: 1.25rem;
        padding: var(--space-md) var(--space-xl);
        border-radius: var(--radius-lg);
    }

    /* Mobile Hero */
    .hero {
        padding: var(--space-2xl) 0;
    }
    
    .hero-buttons {
        justify-content: center;
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
        padding: var(--space-md) var(--space-lg);
        font-size: 1rem;
    }
    
    /* Mobile Features */
    .features, .tools {
        padding: var(--space-2xl) 0;
    }
    
    .feature-grid, .tool-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .feature-card, .tool-card {
        padding: var(--space-lg);
    }
    
    /* Mobile Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
        text-align: center;
    }
    
    /* Mobile Chemistry Container */
    .chemistry-container {
        width: 250px;
        height: 250px;
    }
    
    .molecule {
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }

    .site-logo {
        height: 36px;
    }
    header .container {
        min-height: 48px;
    }
    .logo {
        height: 48px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--space-sm);
    }
    
    .hero-text h1 {
        font-size: 2rem;
    }
    
    .hero-text p {
        font-size: 1rem;
    }
    
    .btn {
        padding: var(--space-sm) var(--space-md);
        font-size: 0.9rem;
    }
    
    .feature-card, .tool-card {
        padding: var(--space-md);
    }
    
    .chemistry-container {
        width: 200px;
        height: 200px;
    }
    
    .molecule {
        width: 40px;
        height: 40px;
        font-size: 0.875rem;
    }
    
    .chat-container {
        margin: 1rem auto 3rem auto;
        border-radius: 15px;
    }
    
    .chat-container.fullscreen {
        height: 100vh;
        width: 100vw;
    }
    
    .chat-container.fullscreen .chat-header {
        min-height: 70px;
        padding: 1rem;
    }
    
    .chat-container.fullscreen .chat-input-container {
        min-height: 80px;
        padding: 1rem;
        display: flex !important;
        background: white !important;
        border-top: 1px solid #e5e7eb;
        align-items: center;
    }
    
    .chat-container.fullscreen .chat-form {
        width: 100%;
        display: flex;
        gap: 0.5rem;
        align-items: center;
    }
    
    .chat-container.fullscreen .chat-form input {
        background: white !important;
        border: 2px solid #e5e7eb;
        color: #1f2937;
        flex: 1;
    }
    
    .chat-container.fullscreen .chat-messages {
        height: calc(100vh - 150px);
        overflow-y: auto;
    }
    
    .chat-header {
        padding: 1rem 1.5rem;
        flex-direction: column;
        gap: 1rem;
    }

    .chat-header-left {
        flex-direction: column;
        text-align: center;
    }

    .chat-title {
        text-align: center;
    }
    
    .chat-header h2 {
        font-size: 1.25rem;
    }

    .fullscreen-btn {
        padding: 0.75rem;
    }
    
    .chat-messages {
        height: 350px;
        padding: 1rem;
    }
    
    .message-content {
        max-width: 90%;
        padding: 0.875rem 1rem;
    }
    
    .chat-input-container {
        padding: 1rem;
    }
    
    .chat-form input {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .chat-form button {
        width: 44px;
        height: 44px;
    }
    
    .input-controls {
        gap: 0.25rem;
    }
    
    .control-btn {
        width: 36px;
        height: 36px;
    }
    
    .input-status {
        margin-top: 0.5rem;
    }
    
    .message-header {
        margin-bottom: 0.25rem;
    }
    
    .tts-btn {
        width: 20px;
        height: 20px;
    }
    
    .uploaded-image img {
        max-width: 90%;
    }
    
    /* About page mobile styles */
    .about-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
        text-align: center;
    }
    
    .about-visual .chemistry-container {
        width: 200px;
        height: 200px;
    }
    
    .mission-vision-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .values-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .page-header p {
        font-size: 1rem;
    }
    
    /* Contact page mobile styles */
    .contact-content {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }
    
    .contact-form-container {
        padding: var(--space-lg);
    }
    
    .faq-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .contact-methods {
        gap: var(--space-md);
    }
    
    .contact-method {
        padding: var(--space-sm);
    }
    
    .method-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
    
    /* Services page mobile styles */
    .services-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .service-card {
        min-height: 250px;
        padding: var(--space-lg);
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .service-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .feature-item .feature-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    /* Simulations page mobile styles */
    .simulations-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .simulation-card {
        min-height: 250px;
        padding: var(--space-lg);
    }
    
    .simulation-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    /* Study materials page mobile styles */
    .class-section {
        padding: var(--space-lg);
    }
    
    .tips-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .tip-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .material-link {
        font-size: 1rem;
        padding: var(--space-sm);
    }
    
    .audio-player {
        padding: var(--space-md);
    }
    
    .audio-player p {
        font-size: 1rem;
    }
}

/* --- Professional Accessibility --- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* --- Professional Focus States --- */
.btn:focus,
nav a:focus,
.logo:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* --- Professional About Page Styles --- */
.page-header {
    padding: var(--space-3xl) 0;
    background: linear-gradient(135deg, var(--background-secondary) 0%, var(--background-tertiary) 100%);
    text-align: center;
    position: relative;
}

.page-header h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    margin-bottom: var(--space-lg);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-blue) 50%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.about-content {
    padding: var(--space-3xl) 0;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    align-items: center;
    margin-bottom: var(--space-3xl);
}

.about-text h2 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    margin-bottom: var(--space-lg);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.about-text p {
    font-size: 1.125rem;
    line-height: 1.7;
    margin-bottom: var(--space-lg);
    color: var(--text-secondary);
}

.about-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.about-visual .chemistry-container {
    width: 300px;
    height: 300px;
}

.mission-vision-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-xl);
    margin-bottom: var(--space-3xl);
}

.mission-card, .vision-card, .tech-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.mission-card::before, .vision-card::before, .tech-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-blue));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mission-card:hover, .vision-card:hover, .tech-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.mission-card:hover::before, .vision-card:hover::before, .tech-card:hover::before {
    opacity: 1;
}

.card-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, var(--primary-color), var(--accent-blue));
    color: var(--text-inverse);
    font-size: 2rem;
    position: relative;
    animation: icon-pulse 3s ease-in-out infinite;
}

.mission-card h3, .vision-card h3, .tech-card h3 {
    margin-bottom: var(--space-md);
    font-size: 1.5rem;
    color: var(--text-primary);
    font-weight: 600;
}

.mission-card p, .vision-card p, .tech-card p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 1rem;
}

.values-section {
    text-align: center;
}

.values-section h2 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    margin-bottom: var(--space-2xl);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-xl);
}

.value-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.value-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.value-item h4 {
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
}

.value-item p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* --- Professional Contact Page Styles --- */
.contact-form-section {
    padding: var(--space-3xl) 0;
    background: var(--background-secondary);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    align-items: start;
}

.contact-info h2 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    margin-bottom: var(--space-lg);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.contact-info p {
    font-size: 1.125rem;
    line-height: 1.7;
    margin-bottom: var(--space-xl);
    color: var(--text-secondary);
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.contact-method {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.contact-method:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.method-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-blue));
    border-radius: var(--radius-md);
    font-size: 1.5rem;
    flex-shrink: 0;
}

.method-details h4 {
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.method-details p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

.contact-form-container {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.form-group label {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
    padding: var(--space-md);
    background: var(--background-primary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: var(--font-body);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: var(--space-xs);
    display: none;
}

.success-message {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    text-align: center;
    font-weight: 500;
    display: none;
}

.error-message[role="alert"] {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    text-align: center;
    font-weight: 500;
    display: none;
}

/* FAQ Section */
.faq-section {
    padding: var(--space-3xl) 0;
    background: var(--background-tertiary);
}

.faq-section h2 {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-xl);
}

.faq-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.faq-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.faq-item h3 {
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
}

.faq-item p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
    margin: 0;
}

/* --- Professional Services Page Styles --- */
.services-section {
    padding: var(--space-3xl) 0;
    background: var(--background-secondary);
}

.services-section h2 {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-xl);
}

.service-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 300px;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-blue));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.service-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(0, 180, 216, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.service-card:hover::before {
    opacity: 1;
}

.service-card:hover::after {
    opacity: 1;
}

.service-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, var(--primary-color), var(--accent-blue));
    color: var(--text-inverse);
    font-size: 2rem;
    position: relative;
    animation: icon-pulse 3s ease-in-out infinite;
}

.service-card h3 {
    margin-bottom: var(--space-md);
    font-size: 1.5rem;
    color: var(--text-primary);
    font-weight: 600;
}

.service-card p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 1rem;
    margin-bottom: var(--space-lg);
    flex-grow: 1;
}

.service-card .btn {
    align-self: center;
    margin-top: auto;
}

/* Features Highlight Section */
.features-highlight {
    padding: var(--space-3xl) 0;
    background: var(--background-tertiary);
}

.features-highlight h2 {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-xl);
}

.feature-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.feature-item .feature-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto var(--space-md);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary-color), var(--accent-blue));
    color: var(--text-inverse);
    font-size: 1.5rem;
    position: relative;
    animation: icon-pulse 3s ease-in-out infinite;
}

.feature-item h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
}

.feature-item p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
    margin: 0;
}

/* --- Professional Simulations Page Styles --- */
.simulations-section {
    padding: var(--space-3xl) 0;
    background: var(--background-secondary);
}

.simulations-section h2 {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.simulations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-xl);
}

.simulation-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 280px;
}

.simulation-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-blue));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.simulation-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(0, 180, 216, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.simulation-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.simulation-card:hover::before {
    opacity: 1;
}

.simulation-card:hover::after {
    opacity: 1;
}

.simulation-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, var(--primary-color), var(--accent-blue));
    color: var(--text-inverse);
    font-size: 1.75rem;
    position: relative;
    animation: icon-pulse 3s ease-in-out infinite;
}

.simulation-card h3 {
    margin-bottom: var(--space-md);
    font-size: 1.4rem;
    color: var(--text-primary);
    font-weight: 600;
}

.simulation-card p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
    margin-bottom: var(--space-lg);
    flex-grow: 1;
}

.simulation-card .btn {
    align-self: center;
          margin-top: auto;
}

/* --- Professional Study Materials Page Styles --- */
.study-materials-section {
    padding: var(--space-3xl) 0;
    background: var(--background-secondary);
}

.study-materials-section h2 {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.class-section {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    margin-bottom: var(--space-2xl);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.class-title {
    font-size: clamp(2rem, 4vw, 2.5rem);
    margin-bottom: var(--space-xl);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    border-bottom: 2px solid var(--glass-border);
    padding-bottom: var(--space-md);
}

.material-category {
    margin-bottom: var(--space-xl);
}

.category-title {
    font-size: 1.5rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.material-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.material-list li {
    margin-bottom: var(--space-md);
}

.material-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1.1rem;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    background: var(--background-primary);
    border: 1px solid transparent;
}

.material-link:hover {
    color: var(--text-primary);
    background: var(--background-tertiary);
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.audio-section {
    display: grid;
    gap: var(--space-lg);
}

.audio-player {
    background: var(--background-primary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all 0.3s ease;
}

.audio-player:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.audio-player p {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: var(--space-md);
}

.audio-player audio {
    width: 100%;
    border-radius: var(--radius-md);
    background: var(--background-tertiary);
}

/* Study Tips Section */
.study-tips-section {
    padding: var(--space-3xl) 0;
    background: var(--background-tertiary);
}

.study-tips-section h3 {
    text-align: center;
    margin-bottom: var(--space-2xl);
    font-size: clamp(2rem, 4vw, 2.5rem);
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-xl);
}

.tip-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.tip-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.tip-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto var(--space-md);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary-color), var(--accent-blue));
    color: var(--text-inverse);
    font-size: 1.5rem;
    position: relative;
    animation: icon-pulse 3s ease-in-out infinite;
}

.tip-item h4 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
}

.tip-item p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
    margin: 0;
}

/* --- Professional Print Styles --- */
@media print {
    .loading-molecule,
    .chemistry-container,
    #hamburger-btn {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .btn {
        border: 1px solid black !important;
        background: white !important;
        color: black !important;
    }
}

.hero-logo {
    display: block;
    margin: 0 auto 2rem auto;
    height: 160px;
    width: auto;
    max-width: 320px;
}

@media (max-width: 768px) {
    .hero-logo {
        height: 112px;
        margin-bottom: 1.2rem;
    }
}

.chatbot-logo {
    display: block;
    margin: 0 auto 1rem auto;
    height: 64px;
    width: auto;
    max-width: 120px;
}

@media (max-width: 768px) {
    .chatbot-logo {
        height: 48px;
        margin-bottom: 0.7rem;
    }
}

/* OCR Results and Upload Status */
.upload-status {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f0f8ff;
    border-radius: 6px;
    margin: 8px 0;
    font-size: 14px;
    color: #0066cc;
}

.ocr-result {
    margin: 10px 0;
}

.extracted-text {
    background: #f8f9fa !important;
    border: 1px solid #e9ecef !important;
    padding: 12px !important;
    border-radius: 6px !important;
    margin: 10px 0 !important;
    font-family: 'Courier New', monospace !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    max-height: 200px !important;
    overflow-y: auto !important;
    line-height: 1.4 !important;
    color: #333 !important;
}

.uploaded-image {
    margin: 10px 0;
}

.uploaded-image img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Desktop header behavior */
@media (min-width: 769px) {
  header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #fff;
  }
  body > .page-header:first-of-type,
  body > main > .page-header:first-of-type,
  body > main > section:first-of-type {
    scroll-margin-top: 80px; /* anchor scroll offset */
  }
}
