/* Project: Care Twin - Professional Medical AI
    Design System: Glassmorphism / Modern SaaS
    Colors: Teal (#00a8a8), Deep Navy (#0a2d2d)
*/

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    /* Brand Colors */
    --primary-teal: #00a8a8;
    --deep-navy: #0a2d2d;
    --teal-soft: rgba(0, 168, 168, 0.1);
    
    /* Light Theme (Default) */
    --bg-dashboard: #f8fbfc;
    --bg-white: #ffffff;
    --text-navy: #0a2d2d;
    --text-muted: #6c757d;
    --border-color: rgba(0, 0, 0, 0.08);
    
    /* Shadows & Transitions */
    --shadow-sm: 0 5px 15px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 15px 35px rgba(10, 45, 45, 0.1);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- DARK MODE THEME --- */
[data-theme="dark"] {
    --bg-dashboard: #121212;
    --bg-white: #1e1e1e;
    --text-navy: #f8f9fa;
    --text-muted: #adb5bd;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* --- BASE STYLES --- */
body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dashboard);
    color: var(--text-navy);
    transition: background-color 0.3s ease;
    overflow-x: hidden;
    margin: 0;
}

h1, h2, h3, h4, .fw-800 { font-weight: 800; }
.ls-1 { letter-spacing: 1px; }
.ls-2 { letter-spacing: 2px; }
.text-teal { color: var(--primary-teal) !important; }
.text-navy { color: var(--deep-navy) !important; }

/* --- NAVIGATION & HEADER --- */
.navbar {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.top-bar {
    background-color: var(--bg-white) !important;
    border-bottom: 1px solid var(--border-color);
}

.user-avatar {
    width: 40px; 
    height: 40px; 
    border-radius: 12px;
    background-color: var(--primary-teal);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- SIDEBAR (AUTO-APPLY PATTERN) --- */
.bg-navy { background-color: var(--deep-navy) !important; }

.sidebar-main .nav-link-custom {
    color: rgba(255, 255, 255, 0.6);
    padding: 12px 16px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.sidebar-main .nav-link-custom:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-main .nav-link-custom.active {
    background-color: #ffffff !important;
    color: var(--deep-navy) !important;
    font-weight: 700;
    box-shadow: var(--shadow-md);
}

.sidebar-main .nav-link-custom.active i { color: var(--primary-teal); }

/* --- DASHBOARD COMPONENTS --- */
.vital-card, .card {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.vital-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

/* Icon Containers */
.icon-circle {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

/* Status Accents */
.bg-danger-soft  { background-color: rgba(229, 62, 62, 0.1); color: #e53e3e; }
.bg-primary-soft { background-color: rgba(49, 130, 206, 0.1); color: #3182ce; }
.bg-teal-soft    { background-color: var(--teal-soft); color: var(--primary-teal); }
.bg-warning-soft { background-color: rgba(221, 107, 32, 0.1); color: #dd6b20; }

/* --- AUTH & HERO SPECIFICS --- */
.auth-brand-side {
    background: linear-gradient(135deg, var(--deep-navy) 0%, #004d40 100%);
    color: white;
}

.input-field {
    position: relative;
    display: flex;
    align-items: center;
}

.input-field input {
    width: 100%;
    padding: 16px 16px 16px 55px;
    background: #f4f9f9;
    border: 2px solid transparent;
    border-radius: 12px;
    transition: var(--transition);
}

.input-field input:focus {
    background: #fff;
    border-color: var(--primary-teal);
    outline: none;
}

.input-field i {
    position: absolute;
    left: 20px;
    color: var(--primary-teal);
}

/* --- BUTTONS --- */
.btn-teal-contact {
    background-color: var(--primary-teal);
    color: white !important;
    border-radius: 50px;
    font-weight: 700;
    padding: 10px 25px;
    border: none;
    transition: var(--transition);
}

.btn-teal-contact:hover {
    background-color: #008a8a;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 168, 168, 0.2);
}

/* --- THEME TOGGLE ANIMATION --- */
.theme-toggle-btn i {
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.theme-toggle-btn:hover i { transform: rotate(15deg) scale(1.2); }

/* --- RESPONSIVENESS --- */
@media (max-width: 991px) {
    .sidebar-main { display: none; }
    .hero-title { font-size: 3.5rem; }
}

/* Mobile Offcanvas Customization */
.offcanvas-start {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* Sidebar Nav in Mobile View */
.offcanvas-body .nav-link-custom {
    color: rgba(255, 255, 255, 0.7);
    padding: 14px 16px;
    border-radius: 12px;
    transition: var(--transition);
}

/* ACTIVE STATE: Matches the AutoApply Image (White block, Navy text) */
.offcanvas-body .nav-link-custom.active {
    background-color: #ffffff !important;
    color: #0a2d2d !important; /* Brand Navy */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.offcanvas-body .nav-link-custom.active i {
    color: #00a8a8; /* Brand Teal */
}

/* Background Overlay (Dimming effect) */
.offcanvas-backdrop.show {
    opacity: 0.7;
    backdrop-filter: blur(4px);
}

/* Emergency Panel Design */
.emergency-panel {
    background-color: #0a2d2d;
    transition: transform 0.3s ease;
}

.hover-bg-light:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Rounded Buttons (Pill Style) */
.btn-outline-teal {
    border: 2px solid var(--primary-teal);
    color: var(--primary-teal);
    transition: all 0.3s;
}

.btn-outline-teal:hover {
    background-color: var(--primary-teal);
    color: white;
}

/* Dark Mode Overrides for Medication Cards */
[data-theme="dark"] .bg-white {
    background-color: #1e1e1e !important;
}

[data-theme="dark"] .border-end {
    border-color: #333 !important;
}
/* Medication Card Styling */
.medication-item {
    transition: var(--transition-snappy);
    border: 1px solid var(--border-color) !important;
}

.medication-item:hover {
    transform: translateX(5px);
    border-color: var(--primary-teal) !important;
}

.med-status-icon i {
    font-size: 1.1rem;
}

/* Background Soft Accents (For consistency) */
.bg-danger-soft { background-color: rgba(220, 53, 69, 0.08); color: #dc3545; }
.bg-teal-soft { background-color: rgba(0, 168, 168, 0.08); color: var(--primary-teal); }
.bg-primary-soft { background-color: rgba(13, 110, 253, 0.08); color: #0d6efd; }

/* Desktop-to-Mobile Specifics */
@media (max-width: 991px) {
    .medication-item .card-body {
        padding: 1.25rem !important;
    }
    
    .medication-item h6 {
        font-size: 0.95rem;
    }
    
    .emergency-panel .btn {
        padding: 1rem !important;
    }
}

/* Dark Mode Integration */
[data-theme="dark"] .medication-item {
    background-color: var(--bg-white) !important;
}

[data-theme="dark"] .list-group-item {
    background-color: transparent !important;
    color: var(--text-navy) !important;
}

#chatWindow {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex-grow: 1;      /* Fill the space */
    overflow-y: auto; /* Allow scrolling */
    min-height: 0;    /* Fixes flexbox overflow bugs */
}