/*! 
 * IDIBELL Hospital System - Custom Styles
 * Version: 1.0.0
 * Description: Unified stylesheet for IDIBELL Hospital system
 * Author: Development Team
 * License: Proprietary
 */

/* ==========================================================================
   TABLE OF CONTENTS
   ========================================================================== */
/*
   1. CSS Variables & Custom Properties
   2. Base & Reset Styles
   3. Typography
   4. Layout Components
   5. UI Components
      5.1. Buttons
      5.2. Forms
      5.3. Cards
      5.4. Navigation
   6. Utility Classes
   7. Media Queries
   8. Print Styles
   9. Animations & Transitions
*/

/* ==========================================================================
   1. CSS VARIABLES & CUSTOM PROPERTIES
   ========================================================================== */
:root {
    /* IDIBELL Corporate Colors - Colores Corporativos Reales */
    --color-primary: #b83c3c;           /* Rojo corporativo IDIBELL */
    --color-primary-dark: #9a2d2d;      /* Rojo más oscuro para hover */
    --color-primary-light: #c54a4a;     /* Rojo más claro para variaciones */
    --color-primary-alpha: rgba(184, 60, 60, 0.1); /* Transparente primario */
    
    --color-secondary: #28a745;         /* Verde médico para éxito */
    --color-secondary-dark: #20c997;    /* Verde más oscuro */
    --color-secondary-light: #6cc04a;   /* Verde más claro */
    
    /* Neutral Colors - Medical Professional Palette */
    --color-text-primary: #2c3e50;     /* Gris oscuro para texto principal */
    --color-text-secondary: #6c757d;   /* Gris medio para texto secundario */
    --color-text-muted: #adb5bd;       /* Gris claro para texto menos importante */
    --color-white: #ffffff;            /* Blanco puro */
    --color-light: #f8f9fa;           /* Fondo gris muy claro */
    --color-border: #dee2e6;          /* Color de bordes claros */
    --color-success: #28a745;         /* Verde para éxito */
    --color-warning: #ffc107;         /* Amarillo para advertencias */
    --color-danger: #dc3545;          /* Rojo para errores */
    --color-info: #17a2b8;           /* Azul para información */
    
    /* Shadcn/UI Design System Variables con colores IDIBELL */
    --background: 0 0% 100%;
    --foreground: 222.2 84% 4.9%;
    --card: 0 0% 100%;
    --card-foreground: 222.2 84% 4.9%;
    --popover: 0 0% 100%;
    --popover-foreground: 222.2 84% 4.9%;
    --primary: 0 64% 49%;              /* Rojo IDIBELL en HSL */
    --primary-foreground: 0 0% 98%;
    --secondary: 134 61% 41%;          /* Verde médico en HSL */
    --secondary-foreground: 134 8% 15%;
    --muted: 210 40% 96%;
    --muted-foreground: 215.4 16.3% 46.9%;
    --accent: 210 40% 96%;
    --accent-foreground: 222.2 84% 4.9%;
    --destructive: 0 72.2% 50.6%;
    --destructive-foreground: 210 40% 98%;
    --border: 214.3 31.8% 91.4%;
    --input: 214.3 31.8% 91.4%;
    --ring: 0 64% 49%;                 /* Focus ring mismo que primario */
    --radius: 0.75rem;
    
    /* Background Gradients */
    --gradient-primary: linear-gradient(45deg, var(--color-primary), var(--color-primary-light));
    --gradient-background: linear-gradient(135deg, #f5f7fa 0%, #e3f2fd 100%);
    --gradient-card: linear-gradient(145deg, var(--color-white) 0%, #fafbfc 100%);
    
    /* Shadows */
    --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.12);
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 25px rgba(184, 60, 60, 0.15);
    --shadow-xl: 0 20px 60px rgba(184, 60, 60, 0.1);
    --shadow-primary: 0 4px 15px var(--color-primary-alpha);
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 20px;
    --radius-round: 50%;
    
    /* Spacing Scale */
    --space-xs: 0.25rem;    /* 4px */
    --space-sm: 0.5rem;     /* 8px */
    --space-md: 1rem;       /* 16px */
    --space-lg: 1.5rem;     /* 24px */
    --space-xl: 2rem;       /* 32px */
    --space-2xl: 3rem;      /* 48px */
    --space-3xl: 4rem;      /* 64px */
    
    /* Typography */
    --font-family-primary: 'Nunito', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-size-xs: 0.75rem;   /* 12px */
    --font-size-sm: 0.875rem;  /* 14px */
    --font-size-base: 1rem;    /* 16px */
    --font-size-lg: 1.125rem;  /* 18px */
    --font-size-xl: 1.25rem;   /* 20px */
    --font-size-2xl: 1.5rem;   /* 24px */
    --font-size-3xl: 2rem;     /* 32px */
    
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    --line-height-tight: 1.2;
    --line-height-base: 1.6;
    --line-height-relaxed: 1.8;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Z-index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* ==========================================================================
   PATIENTS MODULE ENHANCEMENTS - SHADCN/UI INSPIRED
   ========================================================================== */

/* Override Bootstrap with IDIBELL Corporate Colors */
.btn-primary {
    background: hsl(var(--primary)) !important;
    border-color: hsl(var(--primary)) !important;
    color: hsl(var(--primary-foreground)) !important;
}

.btn-primary:hover {
    background: hsl(var(--primary) / 0.9) !important;
    border-color: hsl(var(--primary) / 0.9) !important;
}

.btn-secondary {
    background: hsl(var(--secondary)) !important;
    border-color: hsl(var(--secondary)) !important;
    color: hsl(var(--secondary-foreground)) !important;
}

.btn-secondary:hover {
    background: hsl(var(--secondary) / 0.9) !important;
    border-color: hsl(var(--secondary) / 0.9) !important;
}

/* Form Controls */
.form-control:focus {
    border-color: hsl(var(--ring)) !important;
    box-shadow: 0 0 0 0.2rem hsl(var(--ring) / 0.2) !important;
}

.form-check-input:checked {
    background-color: hsl(var(--primary)) !important;
    border-color: hsl(var(--primary)) !important;
}

.form-check-input:focus {
    border-color: hsl(var(--ring)) !important;
    box-shadow: 0 0 0 0.25rem hsl(var(--ring) / 0.15) !important;
}

/* Dropdown Menus */
.dropdown-menu {
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.dropdown-item {
    transition: all 0.1s;
}

.dropdown-item:hover {
    background-color: hsl(var(--muted));
}

/* Status badges with IDIBELL colors */
.badge.bg-light {
    background-color: hsl(var(--muted)) !important;
    color: hsl(var(--muted-foreground)) !important;
}

/* Pagination */
.pagination .page-link {
    color: hsl(var(--primary));
    border-color: hsl(var(--border));
}

.pagination .page-link:hover {
    background-color: hsl(var(--primary));
    border-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

.pagination .page-item.active .page-link {
    background-color: hsl(var(--primary));
    border-color: hsl(var(--primary));
}

/* Corporate branding for avatars */
.w-8 {
    width: 2rem;
}

.h-8 {
    height: 2rem;
}

.rounded-full {
    border-radius: 9999px;
}

.bg-primary\/10 {
    background-color: hsl(var(--primary) / 0.1);
}

.text-primary {
    color: hsl(var(--primary));
}

.text-destructive {
    color: hsl(var(--destructive));
}

.font-mono {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.font-medium {
    font-weight: 500;
}

.text-xs {
    font-size: 0.75rem;
}

.text-sm {
    font-size: 0.875rem;
}

/* IDIBELL Professional Spacing */
.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

/* Enhanced table hover effects */
.data-table tbody tr:hover {
    background: hsl(var(--muted) / 0.3) !important;
}

/* Loading spinner animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* IDIBELL Corporate Typography */
h1, h2, h3, h4, h5, h6 {
    color: hsl(var(--foreground));
    font-weight: 600;
}

/* Medical professional card styling */
.card {
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

/* ==========================================================================
   2. BASE & RESET STYLES
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-base);
    color: var(--color-text-primary);
    background: var(--gradient-background);
    min-height: 100vh;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Remove default button styles (only for unstyled buttons) */
button:not([class]) {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    cursor: pointer;
}

/* Remove default input styles */
input,
textarea,
select {
    font: inherit;
    margin: 0;
}

/* Remove default link styles */
a {
    color: inherit;
    text-decoration: none;
}

/* Image defaults */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   3. TYPOGRAPHY
   ========================================================================== */
.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted { color: var(--color-text-muted); }
.text-white { color: var(--color-white); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger { color: var(--color-danger); }

.font-weight-normal { font-weight: var(--font-weight-normal); }
.font-weight-medium { font-weight: var(--font-weight-medium); }
.font-weight-semibold { font-weight: var(--font-weight-semibold); }
.font-weight-bold { font-weight: var(--font-weight-bold); }

.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }

/* ==========================================================================
   4. LAYOUT COMPONENTS
   ========================================================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.main-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
}

.section {
    padding: var(--space-2xl) 0;
}

/* Grid utilities */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* ==========================================================================
   5. UI COMPONENTS
   ========================================================================== */

/* 5.1. Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    line-height: 1.5;
    text-align: center;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-base);
    text-decoration: none;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.btn:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Primary Button */
.btn-custom,
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-primary);
    width: 320px;
    height: 65px;
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    margin: 0.75rem;
    border-radius: var(--radius-lg);
    border: 2px solid transparent;
    text-decoration: none;
    transition: var(--transition-base);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    line-height: 1.2;
    max-width: 90%;
}

.btn-custom:hover,
.btn-primary:hover {
    background: linear-gradient(45deg, var(--color-primary-dark), var(--color-primary));
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(184, 60, 60, 0.4);
    color: var(--color-white);
    text-decoration: none;
}

.btn-custom:focus,
.btn-primary:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.btn-custom:active,
.btn-primary:active {
    transform: translateY(0);
}

/* Secondary Button */
.btn-secondary {
    background: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn-secondary:hover {
    background: var(--color-primary);
    color: var(--color-white);
}

/* Outline Button */
.btn-outline {
    background: transparent;
    color: var(--color-text-secondary);
    border-color: var(--color-border);
}

.btn-outline:hover {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

/* Button sizes */
.btn-sm { 
    padding: var(--space-xs) var(--space-md); 
    font-size: var(--font-size-sm);
    height: auto;
    width: auto;
    min-width: 120px;
}

/* Small custom buttons maintain primary styling */
.btn-custom.btn-sm {
    background: var(--gradient-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-sm);
    font-weight: var(--font-weight-semibold);
    border-radius: var(--radius-md);
    margin: var(--space-sm);
}

.btn-custom.btn-sm:hover {
    background: linear-gradient(45deg, var(--color-primary-dark), var(--color-primary));
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    color: var(--color-white);
    text-decoration: none;
}

.btn-lg { 
    padding: var(--space-lg) var(--space-2xl); 
    font-size: var(--font-size-lg);
    height: 70px;
    width: 220px;
}

/* Success Button Variant */
.btn-custom.btn-success {
    background: linear-gradient(45deg, var(--color-success), #34ce57);
    border-color: var(--color-success);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-custom.btn-success:hover {
    background: linear-gradient(45deg, #218838, var(--color-success));
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

/* 5.2. Forms
   -------------------------------------------------------------------------- */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    color: var(--color-text-primary);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-sm);
}

.form-control {
    display: block;
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-base);
    color: var(--color-text-primary);
    background-color: var(--color-white);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: var(--transition-base);
    pointer-events: auto;
    user-select: text;
    cursor: text;
    z-index: 10;
    position: relative;
}

.form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.2rem rgba(184, 60, 60, 0.25);
    outline: none;
}

.form-control:disabled,
.form-control[readonly] {
    background-color: var(--color-light);
    opacity: 1;
    cursor: not-allowed;
}

.form-control.is-invalid {
    border-color: var(--color-danger);
}

.form-control.is-valid {
    border-color: var(--color-success);
}

/* Checkbox and Radio */
.form-check {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: var(--space-sm);
}

.form-check-input {
    width: 1rem;
    height: 1rem;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.form-check-input:checked {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

.form-check-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.25rem rgba(184, 60, 60, 0.25);
}

.form-check-label {
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-sm);
    cursor: pointer;
}

/* Form feedback */
.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: var(--space-xs);
    font-size: var(--font-size-sm);
    color: var(--color-danger);
    font-weight: var(--font-weight-medium);
}

.valid-feedback {
    display: block;
    width: 100%;
    margin-top: var(--space-xs);
    font-size: var(--font-size-sm);
    color: var(--color-success);
    font-weight: var(--font-weight-medium);
}

/* 5.3. Cards
   -------------------------------------------------------------------------- */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.welcome-card {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: var(--space-2xl);
    text-align: center;
    max-width: 500px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.card-header {
    padding: var(--space-lg);
    background: var(--color-light);
    border-bottom: 1px solid var(--color-border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.card-body {
    flex: 1 1 auto;
    padding: var(--space-lg);
}

.card-footer {
    padding: var(--space-lg);
    background: var(--color-light);
    border-top: 1px solid var(--color-border);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* 5.4. Navigation & Links
   -------------------------------------------------------------------------- */
.nav-link {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
    transition: var(--transition-base);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
}

.nav-link:hover {
    color: var(--color-primary);
    background: rgba(184, 60, 60, 0.1);
}

.forgot-password {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-sm);
    transition: var(--transition-base);
}

.forgot-password:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

.back-home {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-sm);
    transition: var(--transition-base);
    display: inline-flex;
    align-items: center;
}

.back-home:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.back-home i {
    margin-right: var(--space-sm);
    font-size: var(--font-size-sm);
}

/* ==========================================================================
   6. SPECIFIC COMPONENTS
   ========================================================================== */

/* Logo Components */
.logo-container {
    margin-bottom: var(--space-xl);
}

.hospital-logo {
    max-height: 80px;
    margin-bottom: var(--space-md);
    width: auto;
    height: auto;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.idibell-logo {
    max-height: 60px;
    margin-top: var(--space-xl);
    width: auto;
    height: auto;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Typography Components */
.title {
    color: var(--color-primary);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-lg);
    font-size: var(--font-size-2xl);
    line-height: var(--line-height-tight);
}

.subtitle {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xl);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
}

/* Bootstrap compatibility overrides */
.img-fluid {
    max-width: 100%;
    height: auto;
}

/* Ensure Bootstrap classes work properly */
.mb-4 {
    margin-bottom: 1.5rem !important;
}

.mt-4 {
    margin-top: 1.5rem !important;
}

.h3 {
    font-size: calc(1.3rem + .6vw);
}

/* Legacy support for existing styles */
.img-small {
    width: auto;
    height: 60px;
}

.header-bg-color {
    background-color: #a2c6fb;
}

.card-header {
    background-color: #a2c6fb !important;
}

/* ==========================================================================
   7. CUSTOM UTILITY CLASSES (Non-Bootstrap)
   ========================================================================== */

/* Custom Grid utilities (not in Bootstrap) */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* ==========================================================================
   8. MEDIA QUERIES
   ========================================================================== */

/* Tablet and medium screens */
@media (max-width: 768px) and (min-width: 577px) {
    .btn-custom {
        width: 300px;
        max-width: 90%;
        height: 60px;
    }
}

/* Mobile phones */
@media (max-width: 576px) {
    .welcome-card {
        padding: var(--space-xl) var(--space-lg);
        margin: var(--space-sm);
        border-radius: var(--radius-lg);
    }
    
    .title {
        font-size: var(--font-size-xl);
    }
    
    .subtitle {
        font-size: var(--font-size-sm);
    }
    
    .btn-custom {
        width: 280px;
        max-width: 95%;
        height: 55px;
        font-size: var(--font-size-lg);
        margin: 0.5rem auto;
        border-radius: var(--radius-md);
    }
    
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .hospital-logo {
        max-height: 60px;
    }
    
    .idibell-logo {
        max-height: 45px;
    }
}

/* ==========================================================================
   9. ANIMATIONS & TRANSITIONS
   ========================================================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Loading states */
.loading {
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: var(--space-sm);
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: var(--radius-round);
    animation: spin 1s linear infinite;
}

/* Fade in animation */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Hover effects */
.hover-lift {
    transition: var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ==========================================================================
   10. PRINT STYLES
   ========================================================================== */
@media print {
    *,
    *::before,
    *::after {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    a,
    a:visited {
        text-decoration: underline;
    }
    
    abbr[title]::after {
        content: " (" attr(title) ")";
    }
    
    pre {
        white-space: pre-wrap !important;
    }
    
    pre,
    blockquote {
        border: 1px solid #999;
        page-break-inside: avoid;
    }
    
    thead {
        display: table-header-group;
    }
    
    tr,
    img {
        page-break-inside: avoid;
    }
    
    p,
    h2,
    h3 {
        orphans: 3;
        widows: 3;
    }
    
    h2,
    h3 {
        page-break-after: avoid;
    }
}

/* ==========================================================================
   10. TIMELINE COMPONENT - Patient Activity Timeline
   ========================================================================== */

.timeline {
    position: relative;
    padding-left: 40px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--color-text-secondary), var(--color-text-muted), var(--color-text-secondary));
    border-radius: var(--radius-sm);
    box-shadow: 0 0 4px rgba(108, 117, 125, 0.3);
}

.timeline-date {
    margin-bottom: var(--space-lg);
    position: relative;
}

.date-header-simple {
    background: var(--gradient-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-lg) var(--space-lg);
    margin-bottom: var(--space-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.date-header-simple:hover {
    background: linear-gradient(135deg, var(--color-light), var(--color-border));
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.date-content {
    display: none;
    margin-left: var(--space-lg);
}

.session-group {
    margin-bottom: var(--space-md);
}

.session-header-simple {
    background: linear-gradient(135deg, var(--color-white), var(--color-light));
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: var(--space-md) var(--space-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    font-weight: 500;
    color: var(--color-text-primary);
}

.session-header-simple:hover {
    background: linear-gradient(135deg, var(--color-light), var(--color-border));
    transform: translateY(-1px);
    box-shadow: var(--shadow-xs);
}

.session-content {
    display: none;
    margin-left: var(--space-lg);
    margin-top: var(--space-sm);
}

.timeline-item {
    display: flex;
    margin-bottom: var(--space-md);
    position: relative;
}

.timeline-marker {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-round);
    position: absolute;
    left: -30px;
    top: 10px;
    border: 2px solid var(--color-white);
    box-shadow: 0 0 0 3px var(--color-text-secondary), 0 0 6px rgba(108, 117, 125, 0.4);
    z-index: 2;
}

.timeline-marker.web {
    background: linear-gradient(135deg, var(--color-text-secondary), var(--color-text-muted));
    box-shadow: 0 0 0 3px var(--color-text-secondary), 0 0 8px rgba(108, 117, 125, 0.5);
}

.timeline-marker.vr {
    background: linear-gradient(135deg, var(--color-text-primary), var(--color-text-secondary));
    box-shadow: 0 0 0 3px var(--color-text-primary), 0 0 8px rgba(44, 62, 80, 0.5);
}

.timeline-content {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: var(--space-md) var(--space-md);
    flex: 1;
    margin-left: var(--space-lg);
    box-shadow: var(--shadow-xs);
    transition: all 0.3s ease;
}

.timeline-content:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.timeline-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.timeline-time {
    font-weight: 600;
    color: var(--color-text-primary);
    font-size: 0.9rem;
    min-width: 70px;
}

.timeline-desc {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

.timeline-right {
    text-align: right;
}

.scene-badge {
    background: var(--gradient-card);
    color: var(--color-text-primary);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--color-border);
}

.toggle-icon {
    transition: transform 0.3s ease;
}

.toggle-icon.rotated {
    transform: rotate(180deg);
}

.badge {
    font-size: 0.75rem;
    padding: 4px 8px;
}

/* Timeline Responsive Design */
@media (max-width: 768px) {
    .timeline {
        padding-left: 30px;
    }

    .timeline::before {
        left: 15px;
    }

    .timeline-marker {
        left: -25px;
    }

    .date-header-simple,
    .session-header-simple {
        padding: var(--space-md) var(--space-md);
        font-size: 1rem;
    }

    .timeline-content {
        margin-left: var(--space-md);
        padding: var(--space-sm) var(--space-md);
    }

    .timeline-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .timeline-time {
        min-width: auto;
        font-size: 0.85rem;
    }

    .timeline-desc {
        font-size: 0.85rem;
    }

    .timeline-right {
        text-align: left;
        margin-top: 8px;
    }
}

/* ==========================================================================
   11. HEADER/NAVBAR COMPONENT - Corporate Header Styles
   ========================================================================== */

.navbar {
    background: var(--color-white) !important;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-xs);
}

.navbar-brand {
    font-weight: var(--font-weight-bold);
    color: var(--color-primary) !important;
}

.navbar-brand:hover {
    color: var(--color-primary-dark) !important;
}

.navbar-brand img {
    filter: brightness(0) saturate(100%) invert(23%) sepia(95%) saturate(7450%) hue-rotate(351deg) brightness(92%) contrast(101%);
}

/* Navbar buttons with corporate styling */
.navbar .btn {
    border-radius: var(--radius-md);
    font-weight: var(--font-weight-medium);
    transition: var(--transition-base);
    border: 1px solid var(--color-border);
    margin: 0;
}

.navbar .btn-outline {
    color: var(--color-text-secondary);
    border-color: var(--color-border);
    background: transparent;
}

.navbar .btn-outline:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-white);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.navbar .btn-secondary {
    background: var(--color-danger);
    border-color: var(--color-danger);
    color: var(--color-white);
}

.navbar .btn-secondary:hover {
    background: #c82333;
    border-color: #bd2130;
    color: var(--color-white);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Responsive navbar adjustments */
@media (max-width: 991.98px) {
    .navbar .d-flex {
        margin-top: var(--space-sm);
    }

    .navbar .btn {
        font-size: 0.875rem;
        padding: var(--space-xs) var(--space-sm);
    }
}