/* Radiology Film Assessment Portal - Clinical Workstation Stylesheet */

:root {
    --rad-sidebar-width: 250px;
    --rad-header-height: 56px;
    --rad-bg-app: #f4f6f9;
    --rad-bg-sidebar: #1e293b;
    --rad-text-sidebar: #94a3b8;
    --rad-text-sidebar-active: #ffffff;
    --rad-bg-sidebar-active: #0284c7;
    --rad-border-color: #e2e8f0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--rad-bg-app);
    color: #1e293b;
    font-size: 0.9rem;
}

/* Navbar */
.rad-navbar {
    height: var(--rad-header-height);
    background-color: #ffffff;
    border-bottom: 1px solid var(--rad-border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    z-index: 1030;
}

/* Sidebar Navigation */
.rad-sidebar {
    width: var(--rad-sidebar-width);
    background-color: var(--rad-bg-sidebar);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    padding-top: var(--rad-header-height);
    padding-bottom: 2rem;
    transition: all 0.2s ease-in-out;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.rad-sidebar .nav-link {
    color: var(--rad-text-sidebar);
    padding: 0.6rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    margin: 0.15rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.rad-sidebar .nav-link:hover {
    color: #f8fafc;
    background-color: rgba(255, 255, 255, 0.08);
}

.rad-sidebar .nav-link.active {
    color: var(--rad-text-sidebar-active);
    background-color: var(--rad-bg-sidebar-active);
}

.rad-sidebar .sidebar-heading {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    padding: 0.75rem 1.25rem 0.25rem;
    font-weight: 700;
}

/* Main Content Area */
.rad-main-content {
    margin-left: var(--rad-sidebar-width);
    padding-top: calc(var(--rad-header-height) + 1.25rem);
    padding-bottom: 2.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    min-height: 100vh;
}

/* Stat Cards */
.rad-stat-card {
    border: 1px solid var(--rad-border-color);
    border-radius: 0.5rem;
    background: #ffffff;
    padding: 1.25rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.rad-stat-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
}

.rad-stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

/* Tables */
.rad-table-card {
    border: 1px solid var(--rad-border-color);
    border-radius: 0.5rem;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    overflow: hidden;
}

.rad-table-card .card-header {
    background: #ffffff;
    border-bottom: 1px solid var(--rad-border-color);
    padding: 1rem 1.25rem;
}

.rad-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    font-weight: 600;
    background-color: #f8fafc;
    border-bottom: 1px solid var(--rad-border-color);
}

.rad-table td {
    vertical-align: middle;
    font-size: 0.875rem;
}

/* Status Badges */
.badge-status {
    font-weight: 600;
    padding: 0.35em 0.65em;
    font-size: 0.75rem;
}

/* DICOM Viewer Fullscreen Layout */
.rad-viewer-container {
    background-color: #0f172a;
    color: #f8fafc;
    min-height: 100vh;
}

.rad-viewer-canvas {
    background-color: #000000;
    border: 1px solid #334155;
    border-radius: 0.375rem;
    min-height: 520px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.rad-viewer-toolbar {
    background-color: #1e293b;
    border-bottom: 1px solid #334155;
    padding: 0.5rem 1rem;
}

/* Auth Layout */
.rad-auth-card {
    max-width: 420px;
    width: 100%;
    border: 1px solid var(--rad-border-color);
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
}

/* -------------------------------------------------------------------------- */
/* Responsive Mobile & Tablet Rules (< 992px) */
/* -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    /* Mobile Off-Canvas Sidebar */
    .rad-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: 270px;
        transform: translateX(-100%);
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1045;
        padding-top: calc(var(--rad-header-height) + 0.5rem);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.25);
    }

    .rad-sidebar.show {
        transform: translateX(0);
    }

    /* Mobile Sidebar Backdrop Overlay */
    .rad-sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(2px);
        z-index: 1040;
        display: none;
        opacity: 0;
        transition: opacity 0.25s ease;
    }

    .rad-sidebar-backdrop.show {
        display: block;
        opacity: 1;
    }

    /* Main Content Area adjustments on Mobile */
    .rad-main-content {
        margin-left: 0 !important;
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        padding-top: calc(var(--rad-header-height) + 0.85rem) !important;
        width: 100% !important;
    }

    /* Navbar styling adjustments for mobile */
    .rad-navbar {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    .navbar-collapse {
        background: #ffffff;
        padding: 1rem;
        border-radius: 0.5rem;
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
        margin-top: 0.5rem;
    }
}

/* Ultra Small Phones (< 576px) */
@media (max-width: 575.98px) {
    .rad-main-content {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    h4, .h4 {
        font-size: 1.15rem;
    }

    .card-body {
        padding: 0.85rem !important;
    }
}

