/* =====================================================
   iMeDIA Ophthalmic AI Dashboard
   ===================================================== */

:root {

    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;

    --text: #172033;
    --text-secondary: #687386;
    --text-muted: #929bad;

    --border: #e5e9f0;

    --primary: #315efb;
    --primary-soft: #eef2ff;

    --shadow:
        0 10px 35px rgba(30, 50, 90, 0.08);

    --radius: 22px;

    --accent-indigo: #4f46e5;
    --accent-cyan: #0284c7;
    --accent-emerald: #059669;
    --accent-rose: #e11d48;
    --accent-amber: #d97706;

    --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.5), 0 0 30px rgba(79, 70, 229, 0.05);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.25);

    --status-bg: rgba(15, 23, 42, 0.6);

    --border-color: rgba(0, 0, 0, 0.08);
    --border-dashed: #cbd5e1;
    --border-highlight: rgba(79, 70, 229, 0.3);
    --glass-backdrop: blur(16px) saturate(180%);
}


[data-theme="dark"] {

    --bg: #0b1020;
    --surface: #12182a;
    --surface-soft: #171e32;

    --text: #f1f5ff;
    --text-secondary: #aab3c7;
    --text-muted: #737e95;

    --border: #242d43;

    --primary: #6d8cff;
    --primary-soft: #1c2545;

    --shadow:
        0 15px 45px rgba(0, 0, 0, 0.35);

    --accent-indigo: #6366f1;
    --accent-cyan: #06b6d4;
    --accent-emerald: #10b981;
    --accent-rose: #f43f5e;
    --accent-amber: #f59e0b;

    --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.5), 0 0 30px rgba(79, 70, 229, 0.05);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.25);

    --status-bg: rgba(15, 23, 42, 0.6);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-dashed: rgba(255, 255, 255, 0.15);
    --border-highlight: rgba(99, 102, 241, 0.3);
}


/* =====================================================
   RESET
   ===================================================== */

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


html {
    scroll-behavior: smooth;
}


body {

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: var(--bg);
    color: var(--text);

    min-height: 100vh;

    transition:
        background 0.3s ease,
        color 0.3s ease;
}


a {
    text-decoration: none;
    color: inherit;
}


/* =====================================================
   HEADER
   ===================================================== */

.topbar {

    height: 76px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 6%;

    background: var(--surface);

    border-bottom:
        1px solid var(--border);

    position: sticky;
    top: 0;

    z-index: 100;

    backdrop-filter: blur(15px);
}


/* Brand */

.brand {

    display: flex;
    align-items: center;
    gap: 12px;
}


.brand-icon {

    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background:
        linear-gradient(
            135deg,
            #315efb,
            #6d5dfc
        );

    color: white;

    font-size: 24px;
    font-weight: 800;
}


.brand-text h1 {

    font-size: 19px;
    line-height: 1;

    letter-spacing: -0.5px;
}


.brand-text span {

    display: block;

    margin-top: 4px;

    color: var(--text-secondary);

    font-size: 11px;

    letter-spacing: 1px;
}


/* Header right */

.header-right {

    display: flex;
    align-items: center;
    gap: 20px;
}


.system-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: var(--surface-soft);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    box-shadow: var(--shadow-lg);
    backdrop-filter: var(--glass-backdrop);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online {
    background: var(--accent-emerald);
    box-shadow: 0 0 10px var(--accent-emerald);
    animation: pulse 2s infinite;
}

.status-dot.offline {
    background: var(--accent-rose);
    box-shadow: 0 0 10px var(--accent-rose);
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.theme-toggle {

    width: 38px;
    height: 38px;

    border-radius: 11px;

    border: 1px solid var(--border);

    background: var(--surface-soft);

    color: var(--text);

    cursor: pointer;

    font-size: 18px;

    transition: 0.2s;
}


.theme-toggle:hover {

    transform: translateY(-2px);

    border-color:
        var(--primary);
}


/* =====================================================
   DASHBOARD
   ===================================================== */

.dashboard {

    width: min(1200px, 88%);

    margin: auto;

    padding:
        65px 0 50px;
}


/* =====================================================
   HERO
   ===================================================== */

.hero {

    min-height: 310px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 55px 60px;

    border-radius: 30px;

    overflow: hidden;

    position: relative;

    background:

        radial-gradient(
            circle at 85% 30%,
            rgba(99, 102, 241, 0.20),
            transparent 35%
        ),

        linear-gradient(
            135deg,
            var(--surface),
            var(--surface-soft)
        );

    border: 1px solid var(--border);

    box-shadow: var(--shadow);
}


.hero-content {

    max-width: 650px;

    position: relative;
    z-index: 2;
}


.eyebrow {

    display: flex;
    align-items: center;
    gap: 9px;

    color: var(--primary);

    font-size: 11px;

    font-weight: 700;

    letter-spacing: 1.5px;

    margin-bottom: 18px;
}


.eyebrow span {

    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: var(--primary);
}


.hero h2 {

    font-size: clamp(38px, 5vw, 58px);

    line-height: 1.05;

    letter-spacing: -2.5px;

    margin-bottom: 20px;
}


.hero h2 span {

    display: block;

    background:
        linear-gradient(
            90deg,
            var(--primary),
            #765dfc
        );

    -webkit-background-clip: text;
    background-clip: text;

    color: transparent;
}


.hero p {

    max-width: 570px;

    color: var(--text-secondary);

    font-size: 16px;

    line-height: 1.7;
}


/* Hero visual */

.hero-visual {

    width: 230px;
    height: 230px;

    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;
}


.retina-ring {

    position: absolute;

    border-radius: 50%;

    border: 1px solid
        rgba(99, 102, 241, 0.2);

    animation: pulse 4s infinite ease-in-out;
}


.ring-1 {

    width: 100%;
    height: 100%;
}


.ring-2 {

    width: 75%;
    height: 75%;

    animation-delay: .5s;
}


.ring-3 {

    width: 50%;
    height: 50%;

    animation-delay: 1s;
}


.eye-symbol {

    width: 80px;
    height: 80px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    color: white;

    font-size: 44px;

    background:
        linear-gradient(
            135deg,
            #315efb,
            #795dfc
        );

    box-shadow:
        0 15px 40px
        rgba(49, 94, 251, .35);
}


@keyframes pulse {

    0%, 100% {
        transform: scale(1);
        opacity: .5;
    }

    50% {
        transform: scale(1.05);
        opacity: 1;
    }
}


/* =====================================================
   SECTION HEADER
   ===================================================== */

.section-header {

    display: flex;

    align-items: end;
    justify-content: space-between;

    margin:
        55px 0 25px;
}


.section-label {

    color: var(--primary);

    font-size: 10px;

    font-weight: 800;

    letter-spacing: 1.5px;
}


.section-header h3 {

    font-size: 28px;

    letter-spacing: -0.8px;

    margin-top: 6px;
}


.section-header p {

    color: var(--text-secondary);

    font-size: 13px;
}


/* =====================================================
   TASK GRID
   ===================================================== */

.task-grid {

    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 22px;
}


/* =====================================================
   TASK CARD
   ===================================================== */

.task-card {

    min-height: 330px;

    padding: 28px;

    background: var(--surface);

    border:
        1px solid var(--border);

    border-radius: var(--radius);

    display: flex;
    flex-direction: column;

    position: relative;

    overflow: hidden;

    box-shadow: var(--shadow);

    transition:
        transform .3s ease,
        box-shadow .3s ease,
        border-color .3s ease;
}


.task-card::before {

    content: "";

    position: absolute;

    width: 180px;
    height: 180px;

    right: -70px;
    top: -80px;

    border-radius: 50%;

    background:
        var(--card-color);

    opacity: .08;

    transition: .3s;
}


.task-card:hover {

    transform:
        translateY(-7px);

    border-color:
        var(--card-color);

    box-shadow:
        0 20px 50px
        rgba(30, 50, 90, .13);
}


.task-card:hover::before {

    transform: scale(1.5);

    opacity: .12;
}


/* Card colors */

.dr-card {
    --card-color: #315efb;
}


.lesion-card {
    --card-color: #8b5cf6;
}


.mgd-card {
    --card-color: #06a6a6;
}


.severity-card {
    --card-color: #f59e0b;
}


/* Card top */

.card-top {

    display: flex;

    justify-content: space-between;

    align-items: center;
}


.task-icon {

    width: 55px;
    height: 55px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 16px;

    background:
        color-mix(
            in srgb,
            var(--card-color) 12%,
            transparent
        );

    color: var(--card-color);

    font-weight: 800;

    font-size: 16px;

    border:
        1px solid
        color-mix(
            in srgb,
            var(--card-color) 20%,
            transparent
        );
}


.arrow {

    width: 38px;
    height: 38px;

    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--surface-soft);

    color: var(--text-secondary);

    transition: .3s;
}


.task-card:hover .arrow {

    background: var(--card-color);

    color: white;

    transform:
        translateX(3px);
}


/* Card content */

.card-content {

    margin-top: 32px;

    flex: 1;
}


.task-category {

    color: var(--card-color);

    font-size: 10px;

    font-weight: 800;

    letter-spacing: 1.2px;
}


.card-content h4 {

    font-size: 25px;

    line-height: 1.15;

    letter-spacing: -0.8px;

    margin:
        9px 0 12px;

    max-width: 330px;
}


.card-content p {

    color: var(--text-secondary);

    font-size: 14px;

    line-height: 1.6;

    max-width: 430px;
}


/* Card footer */

.card-footer {

    display: flex;

    flex-wrap: wrap;

    gap: 7px;

    padding-top: 22px;

    border-top:
        1px solid var(--border);
}


.card-footer span {

    padding:
        6px 10px;

    border-radius: 7px;

    background: var(--surface-soft);

    color: var(--text-secondary);

    font-size: 10px;

    font-weight: 600;
}


/* =====================================================
   INFO PANEL
   ===================================================== */

.info-panel {

    margin-top: 25px;

    padding: 25px 30px;

    display: flex;

    align-items: center;

    gap: 20px;

    border:
        1px solid var(--border);

    border-radius: 18px;

    background: var(--surface);
}


.info-icon {

    width: 46px;
    height: 46px;

    flex-shrink: 0;

    border-radius: 13px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--primary-soft);

    color: var(--primary);

    font-size: 12px;

    font-weight: 800;
}


.info-panel h4 {

    font-size: 15px;

    margin-bottom: 5px;
}


.info-panel p {

    color: var(--text-secondary);

    font-size: 12px;

    line-height: 1.6;
}


/* =====================================================
   FOOTER
   ===================================================== */

footer {

    width: min(1200px, 88%);

    margin: auto;

    padding:
        25px 0 35px;

    display: flex;

    justify-content: space-between;

    color: var(--text-muted);

    font-size: 11px;

    border-top:
        1px solid var(--border);
}


/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 850px) {

    .hero {

        padding: 40px;

    }

    .hero-visual {

        width: 160px;
        height: 160px;

    }

    .task-grid {

        grid-template-columns:
            1fr;

    }

}


@media (max-width: 600px) {

    .topbar {

        padding: 0 5%;

    }

    .system-status {

        display: none;

    }

    .dashboard {

        width: 90%;

        padding-top: 35px;

    }

    .hero {

        padding: 35px 25px;

    }

    .hero-visual {

        display: none;

    }

    .hero h2 {

        font-size: 39px;

    }

    .section-header {

        display: block;

    }

    .section-header p {

        margin-top: 8px;

    }

    .task-card {

        min-height: 300px;

    }

    footer {

        width: 90%;

        flex-direction: column;

        gap: 7px;

    }

}