/**
 * AJK Electricity Department - Legal Case Management System
 * Custom Styles
 */

/* ============================================
   Layout & Structure
   ============================================ */
:root {
    --sidebar-width: 260px;
    --navbar-height: 56px;
    --primary-color: #1a3a5c;
    --secondary-color: #2c5282;
    --accent-color: #3182ce;
    --bg-light: #f0f2f5;
}

body {
    background-color: var(--bg-light);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding-top: var(--navbar-height);
}

/* ============================================
   Top Navbar
   ============================================ */
.top-navbar {
    z-index: 1040;
    height: var(--navbar-height);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    min-height: calc(100vh - var(--navbar-height));
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    z-index: 1030;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar .nav-link {
    color: #adb5bd;
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.sidebar .nav-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.05);
    border-left-color: var(--accent-color);
}

.sidebar .nav-link.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
    border-left-color: var(--accent-color);
}

.sidebar-header {
    background-color: rgba(0, 0, 0, 0.2);
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: calc(100vh - var(--navbar-height));
    transition: margin-left 0.3s ease, width 0.3s ease;
}

/* ============================================
   Dashboard Cards
   ============================================ */
.stat-card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.stat-card .card-body {
    padding: 1.25rem;
}

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card .stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
}

/* ============================================
   Cards & Panels
   ============================================ */
.content-card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.content-card .card-header {
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 1.25rem;
    font-weight: 600;
}

/* ============================================
   Tables
   ============================================ */
.table-responsive {
    border-radius: 0 0 10px 10px;
}

.table thead th {
    background-color: var(--primary-color);
    color: #fff;
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border: none;
    white-space: nowrap;
    padding: 0.75rem;
}

.table tbody td {
    vertical-align: middle;
    font-size: 0.9rem;
    padding: 0.75rem;
}

.table tbody tr:hover {
    background-color: rgba(49, 130, 206, 0.04);
}

/* ============================================
   Forms
   ============================================ */
.form-label {
    font-weight: 500;
    font-size: 0.9rem;
    color: #495057;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(49, 130, 206, 0.15);
}

/* ============================================
   Login Page
   ============================================ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.login-card .card-header {
    background: transparent;
    border-bottom: 1px solid #e9ecef;
    text-align: center;
    padding: 2rem 2rem 1.5rem;
}

.login-card .card-body {
    padding: 2rem;
}

.login-logo {
    font-size: 3rem;
    color: var(--primary-color);
}

/* ============================================
   Badges & Status
   ============================================ */
.badge {
    font-weight: 500;
    padding: 0.4em 0.8em;
    font-size: 0.78rem;
}

/* ============================================
   Action Buttons
   ============================================ */
.btn-action {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border-radius: 4px;
}

/* ============================================
   Page Header
   ============================================ */
.page-header {
    margin-bottom: 1.5rem;
}

.page-header h4 {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0;
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .sidebar,
    .top-navbar,
    .btn,
    .no-print {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    body {
        padding-top: 0;
        background: #fff;
    }

    .content-card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}

/* ============================================
   Sidebar Overlay (Mobile)
   ============================================ */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    width: 100%;
    height: calc(100% - var(--navbar-height));
    background: rgba(0, 0, 0, 0.5);
    z-index: 1025;
}

.sidebar-overlay.show {
    display: block;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .main-content {
        margin-left: 0;
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .stat-card .stat-number {
        font-size: 1.4rem;
    }

    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* ============================================
   Loading Spinner
   ============================================ */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.loading-overlay.show {
    display: flex;
}

/* ============================================
   Case Detail View
   ============================================ */
.detail-label {
    font-weight: 600;
    color: #495057;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.detail-value {
    font-size: 1rem;
    color: #212529;
    margin-bottom: 1rem;
}

/* ============================================
   Filter Bar
   ============================================ */
.filter-bar {
    background-color: #fff;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ============================================
   Today's Hearings Alert
   ============================================ */
.today-alert {
    border-left: 4px solid #dc3545;
    animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% { border-left-color: #dc3545; }
    50% { border-left-color: #ff6b7a; }
}

.hearing-today-badge {
    animation: pulse-bg 1.5s ease-in-out infinite;
}

@keyframes pulse-bg {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ============================================
   Mobile Improvements
   ============================================ */
@media (max-width: 767.98px) {
    .page-header h4 {
        font-size: 1.1rem;
    }

    .stat-card .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .stat-card .stat-number {
        font-size: 1.3rem;
    }

    .stat-card .stat-label {
        font-size: 0.7rem;
    }

    .stat-card .card-body {
        padding: 0.85rem;
    }

    .content-card .card-header {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .table thead th {
        font-size: 0.75rem;
        padding: 0.5rem;
    }

    .table tbody td {
        font-size: 0.8rem;
        padding: 0.5rem;
    }

    .badge {
        font-size: 0.7rem;
        padding: 0.3em 0.6em;
    }

    .btn-action {
        padding: 0.2rem 0.35rem;
        font-size: 0.7rem;
    }

    .filter-bar .form-label {
        font-size: 0.75rem;
    }

    .empty-state {
        padding: 2rem 1rem;
    }

    .empty-state i {
        font-size: 2rem;
    }

    .detail-label {
        font-size: 0.75rem;
    }

    .detail-value {
        font-size: 0.9rem;
    }
}

@media (max-width: 400px) {
    .stat-card .stat-icon {
        display: none;
    }

    .container-fluid.p-4 {
        padding: 0.75rem !important;
    }
}
