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

:root {
    /* Default Dark Mode (Venous Deep Black) */
    --background: #050505;
    --surface: #0a0808;
    --surface-bright: #120d0d;
    --primary: #ff4d4d; /* Arterial Red */
    --primary-deep: #800000; /* Venous Red */
    --primary-container: #1a0a0a;
    --on-surface: #ffffff;
    --on-surface-rgb: 255, 255, 255;
    --on-surface-variant: #d1b4b4;
    --outline: rgba(255, 77, 77, 0.1);
    --glass-bg: rgba(20, 10, 10, 0.4);
    --glass-border: rgba(255, 77, 77, 0.15);
    --accent-gradient: linear-gradient(135deg, var(--primary-deep), var(--primary));
    --transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    --shadow: 0 10px 40px rgba(255, 0, 0, 0.15);
}

[data-theme="light"] {
    --background: #ffffff;
    --surface: #f8f9fa;
    --surface-bright: #e1e4e8;
    --primary: #c62828; 
    --primary-deep: #b71c1c;
    --primary-container: #ffeb3b1a;
    --on-surface: #0a0a0a;
    --on-surface-rgb: 10, 10, 10;
    --on-surface-variant: #404040;
    --outline: rgba(0, 0, 0, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 0, 0, 0.1);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
}

@keyframes plasma-bloom {
    0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    50% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
}

@keyframes cellular-float {
    from { transform: translateY(0) rotate(0deg); }
    to { transform: translateY(-100vh) rotate(360deg); }
}

.blood-cell {
    position: fixed;
    bottom: -50px;
    background: var(--primary);
    border-radius: 50%;
    filter: blur(8px);
    pointer-events: none;
    z-index: -1;
    animation: cellular-float 20s linear infinite;
}

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

body {
    background-color: var(--background);
    color: var(--on-surface);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, .logo {
    font-family: 'Manrope', sans-serif;
    letter-spacing: -0.02em;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Glassmorphism Effect */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.glass:hover {
    border-color: var(--primary);
    box-shadow: 0 25px 50px rgba(255, 0, 0, 0.15);
    transform: translateY(-8px);
}

/* Navigation */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    position: relative;
    z-index: 1002;
}

.nav-toggle {
    display: none !important; /* Force hide on desktop */
    background: transparent;
    border: none;
    color: var(--on-surface);
    font-size: 24px;
    cursor: pointer;
}

.logo {
    font-size: 28px;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 40px;
}

.nav-links a {
    color: var(--on-surface-variant);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600; /* Bolder for visibility */
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 80px 0;
}

.hero h1 {
    font-size: 82px;
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: 24px;
    background: linear-gradient(180deg, #fff 0%, rgba(255,255,255,0.7) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    color: var(--on-surface-variant);
    font-size: 20px;
    max-width: 640px;
    margin: 0 auto 48px;
    font-weight: 400;
}

.hero-btns {
    display: flex;
    gap: 16px;
    margin-top: 32px;
    flex-wrap: wrap; /* Added for mobile wrapping */
    justify-content: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 16px 36px;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    font-size: 16px;
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #ffffff;
}

.pulse {
    animation: button-pulse 2s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes button-pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 77, 77, 0.4); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 15px rgba(255, 77, 77, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 77, 77, 0); }
}

.btn-primary:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 35px rgba(255, 0, 0, 0.4);
    animation-play-state: paused;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: rgba(255, 180, 168, 0.1);
    transform: translateY(-4px);
}

/* Triangular Flow Layout */
.tri-flow {
    position: relative;
    max-width: 1000px;
    margin: 80px auto;
    height: 700px; /* Space for triangulation */
    display: flex;
    justify-content: center;
}

.tri-flow .card {
    position: absolute;
    width: 320px;
    z-index: 2;
}

.tri-top {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

/* Fix displacements on hover by maintaining initial transforms */
.tri-top:hover {
    transform: translateX(-50%) translateY(-15px) rotate(1deg) !important;
}

.tri-left {
    bottom: 0;
    left: 0;
}

.tri-left:hover {
    transform: translateY(-15px) rotate(-1deg);
}

.tri-right {
    bottom: 0;
    right: 0;
}

.tri-right:hover {
    transform: translateY(-15px) rotate(1deg);
}

.flow-paths {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1000px;
    height: 600px;
    z-index: 1;
    pointer-events: none;
}

.vascular-line {
    stroke-dasharray: 10, 10;
    stroke-dashoffset: 200;
    animation: vascular-flow 3s linear infinite;
    stroke: var(--primary);
    stroke-width: 4;
    stroke-linecap: round;
    opacity: 0.2;
    filter: drop-shadow(0 0 5px var(--primary));
}

@keyframes vascular-flow {
    from { stroke-dashoffset: 200; }
    to { stroke-dashoffset: 0; }
}

/* Responsiveness for Tri-Flow */
@media (max-width: 900px) {
    .tri-flow {
        height: auto;
        flex-direction: column;
        align-items: center;
        gap: 40px;
    }
    .tri-flow .card {
        position: relative;
        left: auto !important;
        right: auto !important;
        transform: none !important;
        width: 100%;
        max-width: 400px;
    }
    .flow-paths { display: none; }
}

.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    /* Modern Geometric 'Triangular' dynamic shape */
    clip-path: polygon(0% 10%, 100% 0%, 90% 90%, 10% 100%);
    padding: 60px 40px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.card:hover {
    /* Geometric skew shift on hover */
    clip-path: polygon(10% 0%, 90% 10%, 100% 90%, 0% 100%);
    transform: translateY(-10px) rotate(1deg);
    box-shadow: 0 20px 50px rgba(var(--primary-rgb, 198, 40, 40), 0.1);
    background: rgba(var(--primary-rgb, 198, 40, 40), 0.05);
}

[data-theme="light"] .card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.card-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-container);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 12px;
    transition: var(--transition);
}

.card:hover .card-icon {
    transform: scale(1.1);
    background: rgba(var(--primary-rgb, 198, 40, 40), 0.1);
}

.card h3 {
    font-size: 24px;
    margin-bottom: 16px;
    color: var(--on-surface);
}

.card p {
    color: var(--on-surface-variant);
    font-size: 16px;
    line-height: 1.7;
    font-weight: 500; /* Increased weight for visibility */
}

/* Enhanced visibility for Light Mode biological shapes */
[data-theme="light"] .card {
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    background: rgba(255, 255, 255, 0.9); /* Higher opacity for Light Mode */
}

[data-theme="light"] .card-icon {
    background: rgba(198, 40, 40, 0.1); /* Use primary color */
    border: 1px solid rgba(198, 40, 40, 0.05);
}

/* Forms */
.form-container {
    max-width: 600px;
    margin: 60px auto;
    padding: 48px;
}

.form-group {
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.form-group > div {
    flex: 1;
    min-width: 280px; /* Force stacking on mobile */
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--on-surface-variant);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    background: rgba(var(--on-surface-rgb), 0.08);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--on-surface) !important;
    font-size: 16px;
    font-family: inherit;
    transition: var(--transition);
}

/* Ensure placeholder visibility */
.form-control::placeholder {
    color: var(--on-surface-variant);
    opacity: 0.6;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(var(--on-surface-rgb), 0.08);
    box-shadow: 0 0 15px rgba(255, 77, 77, 0.15);
}

/* 🧬 DROPDOWN CONTRAST FIX */
.form-control option {
    background-color: #1a1a1a !important;
    color: #ffffff !important;
    padding: 12px;
}

[data-theme="light"] .form-control {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .form-control option {
    background-color: #ffffff !important;
    color: #000000 !important;
}

/* Footer */
footer {
    padding: 80px 0 40px;
    text-align: center;
    color: var(--on-surface-variant);
    font-size: 14px;
    margin-top: 120px;
    border-top: 1px solid var(--glass-border);
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: #0e0e0f;
    border-right: 1px solid var(--glass-border);
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 60px 80px;
}

.sidebar-links {
    list-style: none;
    margin-top: 60px;
    flex: 1;
}

.sidebar-links li {
    margin-bottom: 8px;
}

.sidebar-links a {
    color: var(--on-surface-variant);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    border-radius: 12px;
    transition: var(--transition);
    font-size: 15px;
    font-weight: 600; /* Ensure visibility in Light Mode */
}

.sidebar-links a.active {
    background: rgba(255, 180, 168, 0.1);
    color: var(--primary);
    box-shadow: inset 0 0 0 1px rgba(255, 180, 168, 0.2);
}

.sidebar-links a:hover:not(.active) {
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
}

/* Dashboard Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.stat-card {
    padding: 32px;
}

.stat-card h4 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--on-surface-variant);
    margin-bottom: 12px;
}

.stat-card .value {
    font-size: 36px;
    font-weight: 800;
    font-family: 'Manrope';
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Data Tables */
.data-table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 20px;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

th {
    color: var(--on-surface-variant);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

td {
    color: var(--on-surface);
    font-size: 14px;
}

/* Status Badges */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}

.status-Pending { background: rgba(245, 158, 11, 0.1); border: 1px solid #f59e0b; color: #f59e0b; }
.status-Approved { background: rgba(34, 197, 94, 0.1); border: 1px solid #22c55e; color: #22c55e; }
.status-Completed { background: rgba(59, 130, 246, 0.1); border: 1px solid #3b82f6; color: #3b82f6; }
.status-Rejected { background: rgba(239, 68, 68, 0.1); border: 1px solid #ef4444; color: #ef4444; }

/* Biological Inventory Status */
.status-equilibrium { background: rgba(34, 197, 94, 0.1); border: 1px solid #22c55e; color: #4ade80; box-shadow: 0 0 15px rgba(34, 197, 94, 0.2); }
.status-deficit { background: rgba(245, 158, 11, 0.1); border: 1px solid #f59e0b; color: #fbbf24; box-shadow: 0 0 15px rgba(245, 158, 11, 0.2); }
.status-depleted { background: rgba(239, 68, 68, 0.1); border: 1px solid #ef4444; color: #f87171; box-shadow: 0 0 15px rgba(239, 68, 68, 0.2); animation: pulse-critical 2s infinite; }

@keyframes pulse-critical {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.02); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* Landing Page Expansion Styles *//* Password Toggle */
.password-wrapper {
    position: relative;
    display: block;
}

.password-wrapper .form-control {
    padding-right: 48px; /* Room for icon */
}

.password-wrapper .toggle-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer !important;
    color: var(--on-surface-variant);
    font-size: 14px;
    transition: color 0.2s ease;
    z-index: 999 !important; /* Ensure it's always on top */
    padding: 8px; /* Increased hit area */
    pointer-events: auto !important; /* Force clickability */
}

.password-wrapper .toggle-password:hover {
    color: var(--primary);
}

[data-theme="light"] .password-wrapper .toggle-password {
    color: #64748b;
}

[data-theme="light"] .password-wrapper .toggle-password:hover {
    color: var(--primary);
}
.info-section {
    padding: 120px 0;
    position: relative;
    overflow: hidden;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin: 80px 0;
    text-align: center;
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
    padding: 80px 0;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.02);
}

.stat-item h2 {
    font-size: 72px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
    font-weight: 800;
    letter-spacing: -3px;
    filter: drop-shadow(0 0 15px rgba(255, 77, 77, 0.3));
}

.stat-item p {
    text-transform: uppercase;
    font-size: 14px;
    font-weight: 700;
    color: var(--on-surface-variant);
    letter-spacing: 3px;
}

.security-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 100px;
    align-items: center;
    margin: 120px 0;
    padding: 80px;
    border-radius: 40px;
}

.security-icon-container {
    position: relative;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, rgba(255, 77, 77, 0.1) 0%, transparent 70%);
}

.security-icon-container i {
    font-size: 160px;
    color: var(--primary);
    filter: drop-shadow(0 0 30px rgba(255, 77, 77, 0.5));
}

.security-text h2 {
    font-size: 56px;
    margin-bottom: 32px;
    line-height: 1.1;
    font-family: 'Manrope';
}

.security-text p {
    font-size: 20px;
    line-height: 1.8;
    color: var(--on-surface-variant);
}

.network-flow {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 48px;
    margin-top: 100px;
}

.network-step {
    padding: 48px;
    text-align: left;
    border-left: 2px solid var(--primary);
    background: linear-gradient(90deg, rgba(255, 77, 77, 0.03) 0%, transparent 100%);
    transition: var(--transition);
}

.network-step:hover {
    background: linear-gradient(90deg, rgba(255, 77, 77, 0.08) 0%, transparent 100%);
    transform: translateX(10px);
}

.network-step h4 {
    color: var(--primary);
    margin-bottom: 16px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 800;
}

.network-step h3 {
    font-size: 28px;
    margin-bottom: 16px;
}

/* ============================================================
   DEVICE HARDENING (MOBILE / TABLET)
   ============================================================ */

.mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(14, 14, 15, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
}

.mobile-toggle {
    background: transparent;
    border: none;
    color: var(--on-surface);
    font-size: 24px;
    cursor: pointer;
}

.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: 12px;
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
        padding: 100px 20px 40px !important;
    }

    .mobile-header {
        display: flex;
    }

    .hero h1 {
        font-size: 42px;
    }

    .hero p {
        font-size: 18px;
    }

    .glass {
        padding: 24px !important;
    }

    .security-panel {
        grid-template-columns: 1fr;
        padding: 30px;
    }

    .stats-row {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .network-flow {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

@media (max-width: 992px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(14, 14, 15, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 24px;
        gap: 16px;
        border: 1px solid var(--glass-border);
        border-radius: 20px;
        z-index: 1001;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-toggle {
        display: block !important;
    }

    .hero h1 {
        font-size: 42px;
    }

    .form-group {
        margin-bottom: 20px;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .sidebar {
        width: 100%;
    }

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

    .hero-btns .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }
    
    .hero h1 {
        font-size: 32px;
    }

    .glass {
        padding: 24px;
    }
}

/* Dashboard & Action Stacking */
.flex-stack {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

@media (max-width: 768px) {
    .flex-stack {
        flex-direction: column;
        text-align: center;
        justify-content: center;
    }
    
    .flex-stack div {
        width: 100%;
    }
}

/* ============================================================
   GLOBAL VISIBILITY HARDENING (FIXES WHITE-ON-WHITE BUGS)
   ============================================================ */

[data-theme="light"] .form-control {
    background-color: #ffffff !important;
    color: #1a1a1a !important;
    border: 1px solid #cbd5e1 !important;
}

[data-theme="light"] .form-control::placeholder {
    color: #475569 !important;
    opacity: 0.8 !important;
}

[data-theme="light"] .form-control option {
    background-color: #ffffff !important;
    color: #1a1a1a !important;
}

[data-theme="light"] label,
[data-theme="light"] .form-group label {
    color: #1a1a1a !important;
    font-weight: 600 !important;
}

[data-theme="light"] .glass {
    background: rgba(255, 255, 255, 0.98) !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
}

[data-theme="light"] table {
    color: #1a1a1a !important;
}

[data-theme="light"] th {
    background: #f1f5f9 !important;
    color: #1e293b !important;
}

[data-theme="light"] td {
    border-bottom: 1px solid #e2e8f0 !important;
    color: #1a1a1a !important;
}

[data-theme="light"] .data-table-wrapper {
    background: #ffffff !important;
}

[data-theme="light"] .sidebar-links a {
    color: #475569 !important;
}

[data-theme="light"] .sidebar-links a.active {
    background: var(--primary-container) !important;
    color: var(--primary) !important;
}

[data-theme="light"] .stat-card h4 {
    color: #64748b !important;
}

[data-theme="light"] .stat-card .value {
    color: #0f172a !important;
}

[data-theme="light"] h1, 
[data-theme="light"] h2, 
[data-theme="light"] h3 {
    color: #0f172a !important;
}
