/* VL Telemedicine - Modern Healthcare Design System */
:root {
    --primary: #0284c7;
    --primary-hover: #0369a1;
    --primary-light: #e0f2fe;
    --accent: #0d9488;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --border-focus: #38bdf8;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    max-width: 100%;
    overflow-x: hidden;
    overflow-x: clip;
    -webkit-text-size-adjust: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 100%;
    width: 100%;
    overflow-x: hidden;
    overflow-x: clip;
    position: relative;
}

img, svg, video, canvas, audio, iframe {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--primary-hover);
}

/* Layout Elements */
.app-container {
    display: flex;
    min-height: 100vh;
    max-width: 100%;
    width: 100%;
    overflow-x: hidden;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    overflow-x: hidden;
}

.content-body {
    flex: 1;
    padding: 24px;
    max-width: 1300px;
    width: 100%;
    margin: 0 auto;
    min-width: 0;
    overflow-x: hidden;
}

/* Header & Navbar */
.app-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 40;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    flex-shrink: 0;
}

.header-logo-img {
    height: 34px;
    width: auto;
    display: block;
}

.brand-role-badge {
    font-size: 0.75rem;
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.2;
    white-space: nowrap;
}

.header-home-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    background: var(--bg-light);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.header-home-btn:hover {
    background: #e2e8f0;
    color: var(--primary);
}

.header-user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.brand-logo svg {
    width: 28px;
    height: 28px;
    color: var(--primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Sidebar Navigation */
.app-sidebar {
    width: 260px;
    background: #ffffff;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.sidebar-nav {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.15s ease;
}

.nav-link:hover {
    background: var(--bg-body);
    color: var(--primary);
}

.nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

/* Mobile Bottom Navigation (Requirement 49) */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: #ffffff;
    border-top: 1px solid var(--border);
    z-index: 50;
    justify-content: space-around;
    align-items: center;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    flex: 1;
    height: 100%;
}

.mobile-nav-item.active {
    color: var(--primary);
    font-weight: 600;
}

.mobile-nav-item svg {
    width: 22px;
    height: 22px;
    margin-bottom: 2px;
}

@media (max-width: 768px) {
    .app-header {
        padding: 0 10px;
        height: 56px;
        max-width: 100%;
        overflow: visible;
    }
    .brand-logo {
        font-size: 1rem;
        gap: 6px;
        min-width: 0;
        flex-shrink: 0;
    }
    .header-logo-img {
        height: 26px;
        width: auto;
        max-width: 110px;
    }
    .brand-role-badge {
        display: none !important;
    }
    .brand-logo svg {
        width: 22px;
        height: 22px;
        flex-shrink: 0;
    }
    .header-actions,
    .doctor-header-actions {
        gap: 6px;
        flex-shrink: 0;
        display: flex;
        align-items: center;
    }
    .header-home-btn {
        padding: 6px 8px;
        min-width: 32px;
        height: 32px;
        justify-content: center;
    }
    .header-home-btn .home-btn-text {
        display: none !important;
    }
    .notif-badge-container {
        display: inline-flex !important;
        padding: 4px;
        flex-shrink: 0;
    }
    .notif-badge-container svg {
        width: 22px;
        height: 22px;
    }
    .header-user-name,
    .header-doctor-name,
    .header-logout-btn,
    .header-user-badge {
        display: none !important;
    }
    .app-sidebar {
        display: none !important;
    }
    .mobile-bottom-nav {
        display: flex;
    }
    .content-body {
        padding: 12px;
        padding-bottom: 80px;
        max-width: 100%;
        overflow-x: hidden;
    }
}

@media (max-width: 380px) {
    .app-header {
        padding: 0 6px;
    }
    .header-logo-img {
        height: 24px;
        max-width: 95px;
    }
    .header-actions,
    .doctor-header-actions {
        gap: 4px;
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}
.btn-primary:hover {
    background: var(--primary-hover);
    color: #ffffff;
}

.btn-success {
    background: var(--success);
    color: #ffffff;
}
.btn-success:hover {
    background: #059669;
    color: #ffffff;
}

.btn-danger {
    background: var(--danger);
    color: #ffffff;
}
.btn-danger:hover {
    background: #dc2626;
    color: #ffffff;
}

.btn-secondary {
    background: #ffffff;
    border-color: var(--border);
    color: var(--text-main);
}
.btn-secondary:hover {
    background: var(--bg-body);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 12px 24px;
    font-size: 1rem;
    border-radius: var(--radius-lg);
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Badges & Status Indicators */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger  { background: var(--danger-light); color: var(--danger); }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-secondary { background: var(--border); color: var(--text-muted); }

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.status-dot.online { background-color: var(--success); }
.status-dot.busy   { background-color: var(--danger); }
.status-dot.offline { background-color: var(--text-muted); }

/* Grid System */
.grid {
    display: grid;
    gap: 20px;
}
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 992px) {
    .grid-4, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* Stat Widgets */
.stat-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-main);
    background: #ffffff;
    outline: none;
    transition: border-color 0.15s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

/* Tables */
.table-responsive {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table th {
    background: var(--bg-body);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.table tr:hover td {
    background: rgba(241, 245, 249, 0.5);
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.875rem;
}
.alert-success { background: var(--success-light); color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger  { background: var(--danger-light); color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: var(--warning-light); color: #92400e; border: 1px solid #fde68a; }
.alert-info    { background: var(--primary-light); color: #075985; border: 1px solid #bae6fd; }

/* Notification Badge */
.notif-badge-container {
    position: relative;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    text-decoration: none;
    flex-shrink: 0;
    transition: color 0.15s ease;
}
.notif-badge-container:hover {
    color: var(--primary);
}
.notif-count-badge {
    position: absolute;
    top: 0px;
    right: 0px;
    background: var(--danger);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 17px;
    height: 17px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #ffffff;
    box-sizing: border-box;
}
