/* MicroBioPro Enterprise - Custom Design System (No Neon, No Glassmorphism) */
/* Developed by SSoftwares Sistemas — by S.M.S.M. */

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

:root {
    /* Color Palette - Vibrant Modern Enterprise */
    --primary: #0284c7;
    --primary-hover: #0369a1;
    --primary-light: #e0f2fe;
    
    --secondary: #6366f1;
    --secondary-hover: #4f46e5;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;

    /* Light Mode Tokens */
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #0f172a;
    --border-color: #e2e8f0;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] {
    --bg-main: #0b0f19;
    --bg-card: #151c2c;
    --bg-sidebar: #070a12;
    --border-color: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    transition: background-color 0.3s ease, color 0.3s ease;
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4, h5, h6, .brand-font {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

/* Sidebar & Navigation */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 270px;
    background-color: var(--bg-sidebar);
    color: #ffffff;
    flex-shrink: 0;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0;
    margin: 0;
    flex-grow: 1;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1.5rem;
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.sidebar-menu li a:hover,
.sidebar-menu li.active a {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.06);
    border-left: 4px solid var(--primary);
}

.sidebar-menu li a i {
    font-size: 1.15rem;
    color: var(--primary);
}

.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.topbar {
    height: 70px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    box-shadow: var(--shadow-sm);
}

.content-body {
    padding: 2rem;
    flex-grow: 1;
}

/* Cards & Widgets */
.card-custom {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 1.5rem;
}

.card-custom:hover {
    box-shadow: var(--shadow-md);
}

.kpi-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kpi-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.kpi-icon.primary { background: #e0f2fe; color: #0284c7; }
.kpi-icon.success { background: #d1fae5; color: #10b981; }
.kpi-icon.warning { background: #fef3c7; color: #f59e0b; }
.kpi-icon.danger { background: #fee2e2; color: #ef4444; }
.kpi-icon.secondary { background: #e0e7ff; color: #6366f1; }

.kpi-val {
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

/* Digital Pathology WSI Canvas Container */
.wsi-container {
    width: 100%;
    height: 650px;
    background-color: #050811;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    border: 2px solid var(--border-color);
}

.wsi-canvas {
    width: 100%;
    height: 100%;
}

.wsi-toolbar {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 10;
    background: rgba(15, 23, 42, 0.9);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    gap: 8px;
}

.wsi-minimap {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 180px;
    height: 120px;
    background: #000;
    border: 2px solid var(--primary);
    border-radius: 6px;
    z-index: 10;
    overflow: hidden;
}

/* Footer Signature */
.app-footer {
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 1.25rem 2rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.developer-signature {
    font-weight: 600;
    color: var(--primary);
}

/* Theme Switcher Button */
.theme-toggle-btn {
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    color: var(--text-main);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Universal Responsive Design System (Mobile, Tablet, Desktop, 4K & Smart TV) */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
}

@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        transform: translateX(-100%);
        z-index: 1000;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: var(--shadow-lg);
    }

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

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .topbar {
        padding: 0.75rem 1rem;
    }

    .content-body {
        padding: 1rem;
    }
}

@media (max-width: 575.98px) {
    body {
        font-size: 0.875rem;
    }

    .card-custom {
        padding: 1rem;
        border-radius: 10px;
    }

    .wsi-minimap {
        width: 120px;
        height: 80px;
        bottom: 10px;
        right: 10px;
    }

    .wsi-toolbar {
        top: 10px;
        left: 10px;
        padding: 4px 8px;
    }

    .table-responsive {
        font-size: 0.8rem;
    }
}

@media (min-width: 1440px) {
    .main-content {
        max-width: 1920px;
        margin-right: auto;
    }
}

/* Universal Fluid Media & Typography */
img, svg, video, canvas {
    max-width: 100%;
    height: auto;
}

/* Touch target optimizations for mobile devices & touchscreens */
@media (pointer: coarse) {
    .btn, .nav-link, .sidebar-menu a, .form-control, .form-select {
        min-height: 44px;
    }
}

@media (min-width: 2500px) {
    body {
        font-size: 1.25rem;
    }

    .sidebar {
        width: 320px;
    }

    .main-content {
        margin-left: 320px;
    }

    .wsi-container {
        height: 850px;
    }
}
