/* Import Modern Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* CSS Variables for Premium Design System */
:root {
    --color-primary: #1d4381;       /* Deep Hospital Blue */
    --color-primary-light: #2e60ad;
    --color-primary-dark: #0f2347;
    --color-accent: #0ea5e9;        /* Laser/Ophthalmic Cyan */
    --color-accent-rgb: 14, 165, 233;
    --color-success: #10b981;       /* Operational Green */
    --color-success-bg: rgba(16, 185, 129, 0.1);
    --color-warning: #f59e0b;
    --color-bg-dark: #070b19;       /* Deep space navy background */
    --color-bg-card: rgba(15, 23, 42, 0.55);
    --color-border: rgba(255, 255, 255, 0.08);
    --color-border-hover: rgba(14, 165, 233, 0.3);
    --color-text-main: #f8fafc;
    --color-text-muted: #94a3b8;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --shadow-premium: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(14, 165, 233, 0.25);
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    height: 100%;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg-dark);
    color: var(--color-text-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Background Gradients & Mesh */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(at 0% 0%, rgba(29, 67, 129, 0.3) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(14, 165, 233, 0.2) 0px, transparent 50%),
        radial-gradient(at 50% 100%, rgba(15, 23, 42, 0.95) 0px, transparent 70%);
    z-index: -2;
}

body::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    z-index: -1;
    opacity: 0.7;
}

/* Typography */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

p {
    color: var(--color-text-muted);
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-smooth);
}

/* Layout Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.app-header {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--color-border);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(7, 11, 25, 0.7);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-img {
    height: 2.5rem;
    width: auto;
    object-contain: fit;
    filter: drop-shadow(0 0 8px rgba(14, 165, 233, 0.2));
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 30%, #e2e8f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.01em;
}

.system-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--color-success-bg);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #34d399;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: var(--color-success);
    border-radius: 50%;
    position: relative;
}

.status-dot::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: var(--color-success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Hero Section */
.hero {
    padding: 5rem 0 3rem 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.badge {
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.2);
    color: var(--color-accent);
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.05);
}

.badge i {
    font-size: 0.9rem;
    animation: rotate-slow 6s linear infinite;
}

.hero-title {
    font-size: clamp(2.25rem, 5vw, 3.75rem);
    background: linear-gradient(135deg, #ffffff 40%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.25rem;
    max-width: 850px;
    line-height: 1.15;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    max-width: 650px;
    margin-bottom: 3rem;
}

/* Countdown Clock */
.countdown-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 4rem;
    width: 100%;
    max-width: 500px;
}

.countdown-box {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    backdrop-filter: blur(12px);
    flex: 1;
    padding: 1rem 0.5rem;
    border-radius: 1rem;
    text-align: center;
    box-shadow: var(--shadow-premium);
    transition: var(--transition-smooth);
}

.countdown-box:hover {
    border-color: var(--color-border-hover);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.countdown-num {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--color-text-main);
    display: block;
    background: linear-gradient(180deg, #ffffff, #0ea5e9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.countdown-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    font-weight: 600;
    margin-top: 0.25rem;
    display: block;
}

/* Cards Grid / Hub Section */
.hub-section {
    padding: 3rem 0;
}

.section-title {
    text-align: center;
    font-size: 1.75rem;
    margin-bottom: 2.5rem;
    background: linear-gradient(90deg, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.portal-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    backdrop-filter: blur(12px);
    border-radius: 1.5rem;
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-premium);
    position: relative;
    overflow: hidden;
}

.portal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 100% 0%, rgba(14, 165, 233, 0.08) 0%, transparent 60%);
    z-index: 1;
    pointer-events: none;
}

.portal-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--color-border-hover);
    box-shadow: var(--shadow-glow), var(--shadow-premium);
}

.card-icon {
    width: 3.5rem;
    height: 3.5rem;
    background: rgba(14, 165, 233, 0.1);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-accent);
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    transition: var(--transition-smooth);
    border: 1px solid rgba(14, 165, 233, 0.15);
}

.portal-card:hover .card-icon {
    background: var(--color-accent);
    color: var(--color-bg-dark);
    transform: rotate(5deg) scale(1.1);
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.4);
}

.card-title {
    font-size: 1.35rem;
    margin-bottom: 0.75rem;
    color: var(--color-text-main);
}

.card-desc {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
    flex-grow: 1;
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-accent);
    font-weight: 600;
    font-size: 0.95rem;
}

.card-link i {
    transition: var(--transition-smooth);
}

.portal-card:hover .card-link i {
    transform: translateX(5px);
}

/* Interactive Vision Test Widget */
.interactive-section {
    padding: 3rem 0;
}

.widget-container {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    backdrop-filter: blur(12px);
    border-radius: 1.5rem;
    padding: 2.5rem;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: var(--shadow-premium);
    text-align: center;
}

.widget-header {
    margin-bottom: 1.5rem;
}

.widget-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.widget-subtitle {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* Eye Chart Display Box */
.chart-box {
    background: #0b1120;
    border: 2px solid rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    height: 180px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.chart-letter {
    font-size: 90px;
    font-weight: 800;
    color: #ffffff;
    font-family: var(--font-heading);
    user-select: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center;
    display: inline-block;
}

/* Directional Controller Buttons */
.controls-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.control-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--color-border);
    color: var(--color-text-main);
    padding: 0.85rem 0;
    border-radius: 0.75rem;
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition-smooth);
}

.control-btn:hover {
    background: var(--color-accent);
    color: var(--color-bg-dark);
    border-color: var(--color-accent);
    transform: scale(1.05);
}

.control-btn:active {
    transform: scale(0.95);
}

/* Score and Stats overlay */
.widget-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1rem;
}

.stat-val {
    color: var(--color-accent);
    font-weight: 700;
}

.game-start-btn {
    background: var(--color-accent);
    color: var(--color-bg-dark);
    border: none;
    padding: 0.75rem 1.75rem;
    border-radius: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.4);
}

.game-start-btn:hover {
    background: #38bdf8;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.5);
}

/* Form Section */
.notify-section {
    padding: 3rem 0;
    text-align: center;
}

.notify-card {
    background: radial-gradient(circle at 0% 100%, rgba(29, 67, 129, 0.15) 0%, transparent 50%), var(--color-bg-card);
    border: 1px solid var(--color-border);
    backdrop-filter: blur(12px);
    border-radius: 1.5rem;
    padding: 3rem 2rem;
    max-width: 650px;
    margin: 0 auto;
    box-shadow: var(--shadow-premium);
}

.notify-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.notify-desc {
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.notify-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 480px;
    margin: 0 auto;
}

@media (min-width: 600px) {
    .notify-form {
        flex-direction: row;
    }
}

.notify-input {
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    padding: 0.85rem 1.25rem;
    color: var(--color-text-main);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.notify-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.15);
    background: rgba(255, 255, 255, 0.06);
}

.notify-btn {
    background: var(--color-accent);
    color: var(--color-bg-dark);
    border: none;
    padding: 0.85rem 1.75rem;
    border-radius: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.notify-btn:hover {
    background: #38bdf8;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.35);
}

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

/* Footer Section */
.app-footer {
    border-top: 1px solid var(--color-border);
    padding: 3rem 0;
    background: rgba(4, 7, 18, 0.6);
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    margin-bottom: 3rem;
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: 1.5fr 1fr 1fr;
    }
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-brand-title {
    font-size: 1.25rem;
    font-weight: 800;
}

.footer-brand-desc {
    font-size: 0.9rem;
    max-width: 320px;
}

.footer-title {
    font-size: 1rem;
    margin-bottom: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-main);
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links a {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.footer-links a:hover {
    color: var(--color-accent);
    padding-left: 4px;
}

.footer-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 0.85rem;
}

.footer-contact-item i {
    color: var(--color-accent);
    font-size: 1.1rem;
    margin-top: 0.15rem;
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 2rem;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

@media (min-width: 768px) {
    .footer-bottom {
        flex-direction: row;
    }
}

.footer-socials {
    display: flex;
    gap: 1.25rem;
}

.social-icon {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    transition: var(--transition-smooth);
}

.social-icon:hover {
    color: var(--color-accent);
    transform: scale(1.15);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--color-success);
    backdrop-filter: blur(12px);
    color: var(--color-text-main);
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-premium);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: auto;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-icon {
    color: var(--color-success);
    font-size: 1.25rem;
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

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

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

.animate-fade-in {
    animation: slideIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
