/* =============================================
   LegalEase TT - Modern Mobile-First CSS
   Includes: Hero with overlay, glassmorphism, responsive sidebar, dark mode
   ============================================= */

/* ---------- CSS Variables ---------- */
:root {
    --primary-dark: #0a2540;
    --primary: #1e3c72;
    --primary-light: #2a5298;
    --accent: #d4af37;
    --accent-light: #f3e5ab;
    --gray-light: #f8f9fc;
    --gray: #6c757d;
    --dark: #1a1a2e;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --transition: all 0.3s ease;
}

/* Dark mode variables */
[data-bs-theme="dark"] {
    --primary-dark: #0d2b45;
    --primary: #2c3e66;
    --gray-light: #1e1e2f;
    --dark: #f8f9fc;
    --glass-bg: rgba(0, 0, 0, 0.3);
    --glass-border: rgba(255, 255, 255, 0.1);
}

/* ---------- Global Reset & Base (Mobile First) ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--gray-light);
    color: var(--dark);
    line-height: 1.5;
    transition: background 0.3s, color 0.3s;
    font-size: 16px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }

/* Links */
a {
    text-decoration: none;
    color: var(--primary-light);
    transition: var(--transition);
}
a:hover {
    color: var(--accent);
}

/* ---------- Hero Section (with image & overlay) ---------- */
.hero {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    background-image: url('https://images.unsplash.com/photo-1589829545856-d10d557cf95f?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80'); /* legal gavel theme */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* Overlay */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(10,37,64,0.85) 0%, rgba(30,60,114,0.75) 100%);
    z-index: 1;
}

.hero .container {
    position: relative;
    z-index: 2;
    padding: 2rem 1rem;
}

.hero h1 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.hero .lead {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Hero buttons */
.hero .btn {
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
    margin: 0.5rem;
}
.hero .btn-light {
    background: white;
    color: var(--primary);
    border: none;
}
.hero .btn-outline-light {
    border: 2px solid white;
    color: white;
}
.hero .btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* ---------- Glassmorphism Cards ---------- */
.glass-card, .card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    overflow: hidden;
}

.glass-card:hover, .card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card {
    background: white;
    backdrop-filter: none;
}

[data-bs-theme="dark"] .card {
    background: #2d2d44;
    border-color: #40405c;
}

.card-header {
    background: rgba(0,0,0,0.03);
    border-bottom: 1px solid rgba(0,0,0,0.1);
    font-weight: 600;
}

/* ---------- Stat Cards (Dashboard) ---------- */
.stat-card {
    border-radius: 20px;
    padding: 1.25rem;
    background: white;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border-left: 5px solid var(--primary);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-card h5 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray);
}

.stat-card h2 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0;
    color: var(--primary);
}

/* ---------- Sidebar (Mobile-First: hidden by default, show via toggle) ---------- */
.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: white;
    z-index: 1050;
    transition: left 0.3s ease;
    box-shadow: 2px 0 12px rgba(0,0,0,0.1);
    overflow-y: auto;
}

.sidebar.show {
    left: 0;
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1040;
    display: none;
}

.sidebar-overlay.show {
    display: block;
}

/* Desktop sidebar */
@media (min-width: 768px) {
    .sidebar {
        position: sticky;
        top: 0;
        left: 0;
        width: 230px;
        height: 100vh;
        transform: none;
    }
    .sidebar-overlay {
        display: none !important;
    }
    .menu-toggle {
        display: none;
    }
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    margin: 5px 12px;
    transition: var(--transition);
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: rgba(255,255,255,0.2);
    color: white;
    padding-left: 1.8rem;
}

.sidebar .nav-link i {
    width: 24px;
    margin-right: 10px;
    text-align: center;
}

/* ---------- Tables (DataTables) ---------- */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 1rem;
}

.dataTables_wrapper .dataTables_filter input {
    border-radius: 30px;
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    outline: none;
}

table.dataTable {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

table.dataTable td, table.dataTable th {
    padding: 1rem;
    vertical-align: middle;
}

/* ---------- Badges & Alerts ---------- */
.badge-court-today {
    background: var(--danger);
    animation: pulse 1.5s infinite;
    padding: 0.4rem 0.8rem;
    border-radius: 30px;
    font-weight: 500;
}

.badge-starts-soon {
    background: var(--warning);
    color: #000;
    padding: 0.4rem 0.8rem;
    border-radius: 30px;
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
    100% { opacity: 1; transform: scale(1); }
}

/* Toast notifications */
.toast-container {
    z-index: 1090;
}

/* ---------- Forms & Inputs ---------- */
.form-control, .form-select {
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.1);
    padding: 0.7rem 1rem;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(42,82,152,0.2);
}

.btn {
    border-radius: 30px;
    padding: 0.6rem 1.5rem;
    font-weight: 500;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border: none;
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    transform: translateY(-2px);
}

/* ---------- Timeline (Case Details) ---------- */
.timeline {
    position: relative;
    padding-left: 2rem;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--primary-light);
}
.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.8rem;
    top: 0.2rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid white;
}

/* ---------- Document List ---------- */
.doc-item {
    transition: var(--transition);
    border-left: 3px solid transparent;
}
.doc-item:hover {
    border-left-color: var(--accent);
    background: rgba(0,0,0,0.02);
}

/* ---------- Calendar (FullCalendar customization) ---------- */
.fc .fc-button-primary {
    background: var(--primary);
    border: none;
}
.fc .fc-button-primary:hover {
    background: var(--primary-dark);
}
.fc-day-today {
    background: rgba(42,82,152,0.1) !important;
}

/* ---------- Responsive Utilities ---------- */
@media (max-width: 576px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    .hero h1 { font-size: 2rem; }
    .hero .lead { font-size: 1rem; }
    .stat-card h2 { font-size: 1.8rem; }
    .container, .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .card-body {
        padding: 1rem;
    }
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-up {
    animation: fadeInUp 0.6s ease-out;
}

/* ---------- Print Styles ---------- */
@media print {
    .sidebar, .menu-toggle, .btn, .no-print {
        display: none !important;
    }
    body {
        background: white;
        color: black;
    }
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}