/* ===================================
   LUMINA TUTORING - MAIN STYLES
   Optimized for conversions & performance
   =================================== */

/* CSS Variables */
:root {
    --bg: #0B1220;
    --surface: #0F172A;
    --primary: #8B5CF6;
    --secondary: #22D3EE;
    --accent: #F59E0B;
    --text: #E5E7EB;
    --mute-text: #94A3B8;
    --success: #10B981;
    --error: #EF4444;

    /* Gradients */
    --grad-purple: radial-gradient(600px circle at 50% 50%, rgba(139, 92, 246, .33), transparent 60%);
    --grad-cyan: radial-gradient(600px circle at 50% 50%, rgba(34, 211, 238, .33), transparent 60%);
    --grad-main: linear-gradient(135deg, var(--primary), var(--secondary));
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Selection */
::selection {
    background: rgba(139, 92, 246, 0.25);
    color: white;
}

/* Glass Effect */
.glass {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Gradient Backgrounds */
.grad {
    background-image: var(--grad-main);
}

.grad-text {
    background: var(--grad-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-purple {
    background: var(--grad-purple);
}

.bg-gradient-cyan {
    background: var(--grad-cyan);
}

/* Glow Effect */
.glow {
    box-shadow: 0 10px 30px -10px rgba(139, 92, 246, 0.6);
    transition: box-shadow 0.3s ease;
}

.glow:hover {
    box-shadow: 0 15px 40px -10px rgba(139, 92, 246, 0.8);
}

/* Language Toggle */
.lang-toggle button {
    opacity: 0.6;
    transition: opacity 0.2s ease;
    cursor: pointer;
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    padding: 0.25rem 0.5rem;
}

.lang-toggle button:hover {
    opacity: 0.8;
}

.lang-toggle button.active {
    opacity: 1;
    text-decoration: underline;
    text-underline-offset: 6px;
    text-decoration-thickness: 2px;
}

/* Form Styles */
input,
textarea,
select {
    color-scheme: dark;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    background-color: rgba(139, 92, 246, 0.05);
}

select {
    background-color: var(--surface);
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

option {
    background-color: var(--surface);
    color: var(--text);
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    select {
        -webkit-appearance: none;
        background-color: var(--surface);
        color: var(--text);
    }
}

/* Checkbox Styling */
input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    accent-color: var(--primary);
}

/* Button Hover States */
button,
a.button,
[role="button"] {
    transition: all 0.2s ease;
}

button:active,
a.button:active {
    transform: scale(0.98);
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Smooth Transitions */
a,
button {
    transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus Visible */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.5);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.7);
}

/* Mobile Optimizations */
@media (max-width: 640px) {
    body {
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    /* Larger touch targets */
    button,
    a,
    input,
    select,
    textarea {
        min-height: 44px;
    }
}

/* Print Styles */
@media print {

    .no-print,
    header,
    footer,
    .floating-button {
        display: none !important;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .glass {
        background: rgba(255, 255, 255, 0.1);
        border: 2px solid rgba(255, 255, 255, 0.3);
    }
}

/* Dark Mode Specific (already dark, but adding for completeness) */
@media (prefers-color-scheme: dark) {
    body {
        background: var(--bg);
        color: var(--text);
    }
}

/* Performance Optimizations */
.will-change-transform {
    will-change: transform;
}

.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Utility Classes */
.text-balance {
    text-wrap: balance;
}

.container-safe {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
}

/* Success/Error Messages */
.message-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10B981;
    padding: 1rem;
    border-radius: 0.75rem;
}

.message-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #EF4444;
    padding: 1rem;
    border-radius: 0.75rem;
}

/* Quote Card */
.quote-card {
    border-radius: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
}