/**
 * OptimHealth Theme CSS
 * Design System bazat pe culorile din logo
 * Culori principale: Burgundy (#8B2449) și Teal (#2C7A8B)
 */

/* ========================================
   1. VARIABILE CSS - Paleta Oficială OptimHealth
   ======================================== */
:root {
    /* Fundaluri */
    --oh-background: #F4EED6;          /* crem nisipiu cald */
    --oh-background-light: #FAF8F0;    /* variantă mai deschisă */
    
    /* Culori principale */
    --oh-primary: #800020;             /* burgundi oficial */
    --oh-secondary: #008080;           /* teal oficial */
    
    /* Variante Primary (Burgundi) */
    --oh-primary-light: #A6002A;       /* burgundi deschis pentru hover */
    --oh-primary-lighter: #CC0033;     /* burgundi foarte deschis */
    --oh-primary-dark: #660019;        /* burgundi închis */
    --oh-primary-darker: #4D0013;      /* burgundi foarte închis */
    
    /* Variante Secondary (Teal) */
    --oh-secondary-light: #00A3A3;     /* teal deschis pentru hover */
    --oh-secondary-lighter: #00CCCC;   /* teal foarte deschis */
    --oh-secondary-dark: #006666;      /* teal închis */
    --oh-secondary-darker: #004D4D;    /* teal foarte închis */
    
    /* Feedback Colors */
    --oh-success: #2E7D32;             /* verde confirmări */
    --oh-warning: #F39C12;             /* galben-portocaliu atenționări */
    --oh-error: #C0392B;               /* roșu sănătos erori */
    --oh-danger: #C0392B;              /* alias pentru error */
    
    /* Text Colors */
    --oh-text: #1C1C1C;                /* text principal */
    --oh-text-secondary: #4E4E4E;      /* text secundar */
    --oh-on-primary: #FFFFFF;          /* text pe burgundi/teal */
    --oh-on-background: #1C1C1C;       /* text pe fundal crem */
    
    /* Neutre și Borders */
    --oh-border: #D6D3C9;              /* culoare border */
    --oh-muted: #9E9E9E;               /* culoare muted */
    --oh-white: #FFFFFF;
    --oh-black: #000000;
    
    /* Backward compatibility aliases */
    --oh-burgundy: var(--oh-primary);
    --oh-teal: var(--oh-secondary);
    --oh-info: var(--oh-secondary);
    
    /* Culori semantice */
    --oh-success: #10B981;            /* Verde pentru succes */
    --oh-warning: #F59E0B;            /* Portocaliu pentru avertizare */
    --oh-danger: #EF4444;             /* Roșu pentru eroare/pericol */
    --oh-info: var(--oh-teal);        /* Teal pentru informații */
    
    /* Culori medicale profesionale */
    --oh-medical-blue: #2563EB;       /* Albastru medical clasic */
    --oh-medical-blue-light: #3B82F6; /* Albastru medical deschis */
    --oh-medical-blue-dark: #1D4ED8;  /* Albastru medical închis */
    --oh-medical-navy: #1E3A8A;       /* Bleumarin medical profesional */
    
    /* Spacing - conform cu tema oficială */
    --oh-spacing-xs: 0.25rem;      /* 4px */
    --oh-spacing-sm: 0.5rem;       /* 8px */
    --oh-spacing-md: 1rem;         /* 16px */
    --oh-spacing-lg: 1.5rem;       /* 24px */
    --oh-spacing-xl: 2rem;         /* 32px */
    --oh-spacing-2xl: 3rem;        /* 48px */
    
    /* Font Sizes - conform cu tema oficială */
    --oh-font-xs: 0.75rem;         /* 12px */
    --oh-font-sm: 0.875rem;        /* 14px */
    --oh-font-base: 1rem;          /* 16px */
    --oh-font-lg: 1.125rem;        /* 18px */
    --oh-font-xl: 1.25rem;         /* 20px */
    --oh-font-2xl: 1.5rem;         /* 24px */
    --oh-font-3xl: 1.875rem;       /* 30px */
    
    /* Border Radius - conform cu tema oficială */
    --oh-radius-sm: 0.375rem;      /* 6px */
    --oh-radius-md: 0.75rem;       /* 12px */
    --oh-radius-lg: 1.25rem;       /* 20px */
    --oh-radius-xl: 2rem;          /* 32px */
    
    /* Radius Full */
    --oh-radius-full: 9999px;
    
    /* Shadows */
    --oh-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --oh-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --oh-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --oh-shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
    
    /* Transitions */
    --oh-transition-fast: 150ms ease-in-out;
    --oh-transition-normal: 300ms ease-in-out;
    --oh-transition-slow: 500ms ease-in-out;
}

/* ========================================
   2. RESET & BASE STYLES
   ======================================== */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--oh-gray-800);
    background-color: var(--oh-gray-50);
    line-height: 1.6;
}

/* ========================================
   3. COMPONENTE - Butoane
   ======================================== */
   
/* Buton principal (Burgundy) */
.btn-oh-primary {
    background-color: var(--oh-burgundy);
    border-color: var(--oh-burgundy);
    color: var(--oh-white);
    padding: var(--oh-spacing-sm) var(--oh-spacing-lg);
    border-radius: var(--oh-radius-md);
    transition: all var(--oh-transition-fast);
    border: 2px solid transparent;
}

.btn-oh-primary:hover {
    background-color: transparent !important;
    border-color: var(--oh-burgundy) !important;
    color: var(--oh-burgundy) !important;
    transform: translateY(-1px);
    box-shadow: var(--oh-shadow-md);
}

/* Buton secundar (Teal) */
.btn-oh-secondary {
    background-color: var(--oh-teal);
    border-color: var(--oh-teal);
    color: var(--oh-white);
    padding: var(--oh-spacing-sm) var(--oh-spacing-lg);
    border-radius: var(--oh-radius-md);
    transition: all var(--oh-transition-fast);
    border: 2px solid transparent;
}

.btn-oh-secondary:hover {
    background-color: transparent !important;
    border-color: var(--oh-teal) !important;
    color: var(--oh-teal) !important;
    transform: translateY(-1px);
    box-shadow: var(--oh-shadow-md);
}

/* Buton outline */
.btn-oh-outline-primary {
    background-color: transparent;
    border: 2px solid var(--oh-burgundy);
    color: var(--oh-burgundy);
    padding: var(--oh-spacing-sm) var(--oh-spacing-lg);
    border-radius: var(--oh-radius-md);
    transition: all var(--oh-transition-fast);
}

.btn-oh-outline-primary:hover {
    background-color: var(--oh-burgundy);
    color: var(--oh-white);
    transform: translateY(-1px);
    box-shadow: var(--oh-shadow-md);
}

.btn-oh-outline-secondary {
    background-color: transparent;
    border: 2px solid var(--oh-teal);
    color: var(--oh-teal);
    padding: var(--oh-spacing-sm) var(--oh-spacing-lg);
    border-radius: var(--oh-radius-md);
    transition: all var(--oh-transition-fast);
}

.btn-oh-outline-secondary:hover {
    background-color: var(--oh-teal);
    color: var(--oh-white);
    transform: translateY(-1px);
    box-shadow: var(--oh-shadow-md);
}

/* Butonul Caută înlocuitor - burgundy normal, transparent la hover */
.btn-oh-warning {
    background-color: var(--oh-burgundy) !important;
    border: 2px solid var(--oh-burgundy) !important;
    color: var(--oh-white) !important;
    padding: var(--oh-spacing-sm) var(--oh-spacing-lg);
    border-radius: var(--oh-radius-md);
    transition: all var(--oh-transition-fast);
}

.btn-oh-warning:hover {
    background-color: transparent !important;
    border-color: var(--oh-burgundy) !important;
    color: var(--oh-burgundy) !important;
    transform: translateY(-1px);
    box-shadow: var(--oh-shadow-md);
}

/* ========================================
   4. COMPONENTE - Card-uri
   ======================================== */
.card-oh {
    background: var(--oh-white);
    border: 1px solid var(--oh-gray-200);
    border-radius: var(--oh-radius-lg);
    padding: var(--oh-spacing-lg);
    box-shadow: var(--oh-shadow-sm);
    transition: all var(--oh-transition-normal);
}

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

.card-oh-header {
    border-bottom: 2px solid var(--oh-teal);
    padding-bottom: var(--oh-spacing-md);
    margin-bottom: var(--oh-spacing-lg);
}

.card-oh-burgundy {
    border-top: 4px solid var(--oh-burgundy);
}

.card-oh-teal {
    border-top: 4px solid var(--oh-teal);
}

/* ========================================
   5. COMPONENTE - Navbar
   ======================================== */
.navbar-oh {
    background: linear-gradient(135deg, var(--oh-burgundy) 0%, var(--oh-burgundy-dark) 100%);
    box-shadow: var(--oh-shadow-md);
    padding: var(--oh-spacing-md) 0;
}

.navbar-oh .navbar-brand {
    color: var(--oh-white);
    font-weight: 600;
    font-size: 1.5rem;
}

.navbar-oh .nav-link {
    color: rgba(255, 255, 255, 0.9);
    transition: all var(--oh-transition-fast);
    padding: var(--oh-spacing-sm) var(--oh-spacing-md);
    border-radius: var(--oh-radius-md);
}

.navbar-oh .nav-link:hover {
    color: var(--oh-white);
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar-oh .nav-link.active {
    color: var(--oh-white);
    background-color: rgba(255, 255, 255, 0.2);
}

/* ========================================
   6. COMPONENTE - Sidebar
   ======================================== */
.sidebar-oh {
    background: var(--oh-white);
    border-right: 1px solid var(--oh-gray-200);
    min-height: calc(100vh - 60px);
    padding: var(--oh-spacing-lg);
}

.sidebar-oh-header {
    color: var(--oh-teal);
    font-weight: 600;
    font-size: 1.25rem;
    border-bottom: 2px solid var(--oh-teal);
    padding-bottom: var(--oh-spacing-sm);
    margin-bottom: var(--oh-spacing-lg);
}

.sidebar-oh-item {
    padding: var(--oh-spacing-sm);
    margin-bottom: var(--oh-spacing-xs);
    border-radius: var(--oh-radius-md);
    transition: all var(--oh-transition-fast);
    cursor: pointer;
}

.sidebar-oh-item:hover {
    background-color: var(--oh-gray-100);
    padding-left: var(--oh-spacing-md);
}

.sidebar-oh-item.active {
    background-color: var(--oh-teal);
    color: var(--oh-white);
}

/* ========================================
   7. COMPONENTE - Forms
   ======================================== */
.form-control-oh {
    border: 2px solid var(--oh-gray-300);
    border-radius: var(--oh-radius-md);
    padding: var(--oh-spacing-sm) var(--oh-spacing-md);
    transition: all var(--oh-transition-fast);
}

.form-control-oh:focus {
    border-color: var(--oh-teal);
    box-shadow: 0 0 0 3px rgba(44, 122, 139, 0.1);
    outline: none;
}

.form-label-oh {
    color: var(--oh-gray-700);
    font-weight: 500;
    margin-bottom: var(--oh-spacing-xs);
}

/* ========================================
   8. COMPONENTE - Badges & Pills
   ======================================== */
.badge-oh-primary {
    background-color: var(--oh-burgundy);
    color: var(--oh-white);
    padding: var(--oh-spacing-xs) var(--oh-spacing-sm);
    border-radius: var(--oh-radius-full);
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-oh-secondary {
    background-color: var(--oh-teal);
    color: var(--oh-white);
    padding: var(--oh-spacing-xs) var(--oh-spacing-sm);
    border-radius: var(--oh-radius-full);
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-oh-success {
    background-color: var(--oh-success);
    color: var(--oh-white);
    padding: var(--oh-spacing-xs) var(--oh-spacing-sm);
    border-radius: var(--oh-radius-full);
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-oh-warning {
    background-color: var(--oh-warning);
    color: var(--oh-white);
    padding: var(--oh-spacing-xs) var(--oh-spacing-sm);
    border-radius: var(--oh-radius-full);
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-oh-danger {
    background-color: var(--oh-danger);
    color: var(--oh-white);
    padding: var(--oh-spacing-xs) var(--oh-spacing-sm);
    border-radius: var(--oh-radius-full);
    font-size: 0.875rem;
    font-weight: 500;
}

/* ========================================
   9. COMPONENTE - Alerts
   ======================================== */
.alert-oh-info {
    background-color: rgba(44, 122, 139, 0.1);
    border: 1px solid var(--oh-teal);
    border-left: 4px solid var(--oh-teal);
    color: var(--oh-teal-dark);
    padding: var(--oh-spacing-md);
    border-radius: var(--oh-radius-md);
}

.alert-oh-success {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--oh-success);
    border-left: 4px solid var(--oh-success);
    color: #047857;
    padding: var(--oh-spacing-md);
    border-radius: var(--oh-radius-md);
}

.alert-oh-warning {
    background-color: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--oh-warning);
    border-left: 4px solid var(--oh-warning);
    color: #92400E;
    padding: var(--oh-spacing-md);
    border-radius: var(--oh-radius-md);
}

.alert-oh-danger {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--oh-danger);
    border-left: 4px solid var(--oh-danger);
    color: #991B1B;
    padding: var(--oh-spacing-md);
    border-radius: var(--oh-radius-md);
}

/* ========================================
   10. COMPONENTE - Tables
   ======================================== */
.table-oh {
    width: 100%;
    background: var(--oh-white);
    border-radius: var(--oh-radius-lg);
    overflow: hidden;
    box-shadow: var(--oh-shadow-sm);
}

.table-oh thead {
    background: linear-gradient(135deg, var(--oh-teal) 0%, var(--oh-teal-dark) 100%);
}

.table-oh thead th {
    color: var(--oh-white);
    font-weight: 600;
    padding: var(--oh-spacing-md);
    text-align: left;
    border: none;
}

.table-oh tbody tr {
    border-bottom: 1px solid var(--oh-gray-200);
    transition: all var(--oh-transition-fast);
}

.table-oh tbody tr:hover {
    background-color: var(--oh-gray-50);
}

.table-oh tbody td {
    padding: var(--oh-spacing-md);
}

/* ========================================
   11. COMPONENTE - Loading & Spinners
   ======================================== */
.spinner-oh {
    width: 40px;
    height: 40px;
    border: 4px solid var(--oh-gray-200);
    border-top-color: var(--oh-burgundy);
    border-radius: 50%;
    animation: spin-oh 1s linear infinite;
}

@keyframes spin-oh {
    to { transform: rotate(360deg); }
}

.loading-oh {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--oh-spacing-2xl);
}

/* ========================================
   12. UTILITĂȚI
   ======================================== */
   
/* Text Colors */
.text-oh-primary { color: var(--oh-burgundy); }
.text-oh-secondary { color: var(--oh-teal); }
.text-oh-success { color: var(--oh-success); }
.text-oh-warning { color: var(--oh-warning); }
.text-oh-danger { color: var(--oh-danger); }

/* Background Colors */
.bg-oh-primary { background-color: var(--oh-burgundy); }
.bg-oh-secondary { background-color: var(--oh-teal); }
.bg-oh-primary-light { background-color: var(--oh-burgundy-lighter); }
.bg-oh-secondary-light { background-color: var(--oh-teal-lighter); }
.bg-oh-success { background-color: var(--oh-success); }
.bg-oh-warning { background-color: var(--oh-warning); }
.bg-oh-danger { background-color: var(--oh-danger); }
.bg-oh-muted { background-color: var(--oh-gray-500); }
.bg-oh-teal { background-color: var(--oh-teal); }
.bg-oh-burgundy { background-color: var(--oh-burgundy); }

/* Borders */
.border-oh-primary { border-color: var(--oh-burgundy) !important; }
.border-oh-secondary { border-color: var(--oh-teal) !important; }
.border-oh-muted { border-color: var(--oh-gray-400) !important; }
.border-oh-teal { border-color: var(--oh-teal) !important; }
.border-oh-burgundy { border-color: var(--oh-burgundy) !important; }

/* Authentication Styles */
.btn-oh-auth {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-oh-auth:hover {
    background: rgba(255,255,255,0.3);
    color: white;
    transform: translateY(-1px);
}

.btn-oh-outline-light {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    transition: all 0.3s ease;
}

.btn-oh-outline-light:hover {
    background: rgba(255,255,255,0.2);
    color: white;
    transform: translateY(-1px);
}

/* Text Color Utilities */
.text-oh-burgundy { color: var(--oh-burgundy); }

/* Medicine and Disease Name Styling */
.medicine-title,
.card-title {
    color: var(--oh-secondary) !important;
    font-weight: 600;
}

/* ATC Classification Links - schimbă din albastru în teal */
.atc-list-item a {
    color: var(--oh-secondary) !important;
}

.atc-list-item a:hover {
    color: var(--oh-secondary-dark) !important;
}

.atc-code {
    color: var(--oh-secondary) !important;
    font-weight: 600;
}

/* Breadcrumb links pentru ATC */
.breadcrumb-item a {
    color: var(--oh-secondary) !important;
}

.breadcrumb-item a:hover {
    color: var(--oh-secondary-dark) !important;
}

/* General ATC styling */
.atc-hierarchy-item .atc-code,
.atc-content .atc-code {
    color: var(--oh-secondary) !important;
    font-weight: 600;
}

/* Logout Button - schimbă din roșu în burgundy */
.btn-outline-danger {
    border-color: var(--oh-primary) !important;
    color: var(--oh-primary) !important;
}

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

/* Butoanele Vezi medicamente - schimbă din albastru în teal */
.btn-outline-primary {
    border-color: var(--oh-secondary) !important;
    color: var(--oh-secondary) !important;
}

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

/* Text primary în cardul medicamente selectate - schimbă din albastru în teal */
.text-primary {
    color: var(--oh-secondary) !important;
}

/* Scrisul albastru din cardul medicamente selectate */
.global-medicine-item .text-primary,
.selected-medicine-item .text-primary,
.medicine-name.text-primary {
    color: var(--oh-secondary) !important;
}

/* Text info pentru Sursă și Match din rezultatele căutării de boli - schimbă din albastru în burgundy */
.text-info {
    color: var(--oh-primary) !important;
}

/* Butonul Login - schimbă din verde în teal */
.btn-success {
    background-color: var(--oh-secondary) !important;
    border-color: var(--oh-secondary) !important;
    color: white !important;
}

.btn-success:hover {
    background-color: var(--oh-secondary-dark) !important;
    border-color: var(--oh-secondary-dark) !important;
    color: white !important;
}

/* Checkbox-uri pentru înlocuitor - schimbă din albastru în burgundy */
.replacement-checkbox,
.medicine-checkbox,
input[type="checkbox"] {
    accent-color: var(--oh-primary) !important;
}

input[type="checkbox"]:checked {
    accent-color: var(--oh-primary) !important;
    background-color: var(--oh-primary) !important;
    border-color: var(--oh-primary) !important;
}

/* Pentru Bootstrap form-check */
.form-check-input:checked {
    background-color: var(--oh-primary) !important;
    border-color: var(--oh-primary) !important;
}

.form-check-input:focus {
    border-color: var(--oh-primary) !important;
    box-shadow: 0 0 0 0.25rem rgba(128, 0, 32, 0.25) !important;
}

/* Badge primary pentru numărul de rezultate și scor - schimbă din albastru în burgundy */
.badge.bg-primary {
    background-color: var(--oh-primary) !important;
    color: white !important;
}

/* Specifice pentru rezultatele căutării de boli */
#resultsCount.badge.bg-primary,
.disease-result-card .badge.bg-primary {
    background-color: var(--oh-primary) !important;
    color: white !important;
}

/* Hover Effects */
.hover-scale:hover {
    transform: scale(1.05);
    transition: transform var(--oh-transition-fast);
}

.hover-shadow:hover {
    box-shadow: var(--oh-shadow-lg);
    transition: box-shadow var(--oh-transition-normal);
}

/* Gradient Backgrounds */
.gradient-oh-primary {
    background: linear-gradient(135deg, var(--oh-burgundy) 0%, var(--oh-burgundy-dark) 100%);
}

.gradient-oh-secondary {
    background: linear-gradient(135deg, var(--oh-teal) 0%, var(--oh-teal-dark) 100%);
}

.gradient-oh-mixed {
    background: linear-gradient(135deg, var(--oh-burgundy) 0%, var(--oh-teal) 100%);
}

/* ========================================
   13. RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .sidebar-oh {
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid var(--oh-gray-200);
    }
    
    .card-oh {
        padding: var(--oh-spacing-md);
    }
    
    .navbar-oh .navbar-brand {
        font-size: 1.25rem;
    }
}

/* ========================================
   14. DARK MODE (Opțional)
   ======================================== */
@media (prefers-color-scheme: dark) {
    :root {
        --oh-bg-primary: var(--oh-gray-900);
        --oh-bg-secondary: var(--oh-gray-800);
        --oh-text-primary: var(--oh-gray-100);
        --oh-text-secondary: var(--oh-gray-300);
    }
    
    body.dark-mode {
        background-color: var(--oh-bg-primary);
        color: var(--oh-text-primary);
    }
    
    .card-oh {
        background: var(--oh-bg-secondary);
        border-color: var(--oh-gray-700);
    }
}

/* ========================================
   15. ANIMAȚII
   ======================================== */
.fade-in-oh {
    animation: fadeIn var(--oh-transition-slow) ease-in;
}

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

.slide-in-oh {
    animation: slideIn var(--oh-transition-normal) ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}