/* ===========================================
   Bariatric Care Portal - Styles
   =========================================== */

/* --- Layout --- */
.sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
}
.sidebar.open {
    transform: translateX(0);
}
@media (min-width: 768px) {
    .sidebar {
        transform: translateX(0);
    }
}

/* --- Cards --- */
.card {
    background: white;
    border: 2px solid #d1d5db;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}
.card-body {
    padding: 1rem;
}
@media (min-width: 768px) {
    .card-body {
        padding: 1.5rem;
    }
}

/* --- Section Headers --- */
.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #2563eb;
    margin-bottom: 1rem;
}

/* --- Nav Links --- */
.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-radius: 0.5rem;
    color: #1f2937;
    transition: background-color 0.15s ease;
}
.nav-link:hover {
    background-color: #eff6ff;
}
.nav-link.active {
    background-color: #eff6ff;
}
.nav-link svg {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
}

/* --- Status Colors --- */
.status-red    { background: #fef2f2; border-left: 4px solid #ef4444; }
.status-yellow { background: #fefce8; border-left: 4px solid #eab308; }
.status-green  { background: #f0fdf4; border-left: 4px solid #22c55e; }
.status-blue   { background: #eff6ff; border-left: 4px solid #3b82f6; }

.badge-red    { background: #dc2626; color: white; }
.badge-yellow { background: #ca8a04; color: white; }
.badge-green  { background: #16a34a; color: white; }
.badge-blue   { background: #2563eb; color: white; }

/* --- Stat Cards --- */
.stat-card {
    border: 2px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}
.stat-card.blue   { background: #eff6ff; border-color: #bfdbfe; }
.stat-card.green  { background: #f0fdf4; border-color: #bbf7d0; }
.stat-card.yellow { background: #fefce8; border-color: #fef08a; }
.stat-card.white  { background: white; }

.stat-card .label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}
.stat-card .value {
    font-size: 1.5rem;
    font-weight: 700;
}
.stat-card .sub {
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* --- Forum Categories --- */
.forum-cat {
    padding: 1rem;
    border-radius: 0.5rem;
    border: 2px solid;
    cursor: pointer;
    transition: box-shadow 0.15s ease;
}
.forum-cat:hover {
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}
.forum-cat.blue   { background: linear-gradient(to bottom right, #eff6ff, #dbeafe); border-color: #bfdbfe; }
.forum-cat.green  { background: linear-gradient(to bottom right, #f0fdf4, #dcfce7); border-color: #bbf7d0; }
.forum-cat.purple { background: linear-gradient(to bottom right, #faf5ff, #f3e8ff); border-color: #e9d5ff; }

/* --- Chat --- */
.chat-bubble {
    padding: 0.75rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
}
.chat-bubble.incoming {
    background: white;
    border: 2px solid #d1d5db;
    border-top-left-radius: 0;
}
.chat-bubble.outgoing {
    background: #2563eb;
    color: white;
    border-top-right-radius: 0;
}

.avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: white;
    flex-shrink: 0;
}
.avatar.blue   { background: #2563eb; }
.avatar.green  { background: #16a34a; }
.avatar.purple { background: #9333ea; }
.avatar.yellow { background: #ca8a04; }
.avatar.indigo { background: #4f46e5; }

/* --- Body Scan Animation --- */
.human-body {
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.3));
}
.body-point {
    transition: all 0.3s ease;
    cursor: pointer;
}
.body-point:hover {
    r: 8;
    fill: #3b82f6;
}
.scan-line {
    animation: scan 3s ease-in-out infinite;
}
@keyframes scan {
    0%, 100% { opacity: 0; transform: translateY(0); }
    50% { opacity: 0.4; transform: translateY(250px); }
}

/* --- Chart --- */
#progressChart {
    width: 100%;
    height: 100%;
}
#progressChart .vega-embed {
    width: 100%;
    height: 100%;
}
#progressChart .vega-embed details {
    display: none !important;
}

/* --- Typing Indicator --- */
.typing-dot {
    width: 0.5rem;
    height: 0.5rem;
    background: white;
    border-radius: 9999px;
    animation: bounce 1s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* --- Mobile --- */
@media (max-width: 640px) {
    button, a {
        min-height: 44px;
        min-width: 44px;
    }
    body {
        -webkit-font-smoothing: antialiased;
        overflow-x: hidden;
    }
    .avatar {
        width: 1.75rem;
        height: 1.75rem;
    }
}

/* --- User Dropdown --- */
#userDropdown {
    animation: fadeIn 0.15s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Form Inputs --- */
input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
