/* ============================================================
   AI ACCIDENT PILOT - COMPLETE STYLES
   ============================================================
   All styles for the entire application
   ============================================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f2f5;
    color: #1B2A4A;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ─── TYPOGRAPHY ────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: #1B2A4A;
    line-height: 1.2;
}

a {
    color: #8B0000;
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: #a00000;
    text-decoration: underline;
}

/* ─── CONTAINERS ────────────────────────────────────────────── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ─── BUTTONS ────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: #8B0000;
    color: #ffffff;
}

.btn-primary:hover {
    background: #a00000;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(139, 0, 0, 0.3);
    text-decoration: none;
    color: #ffffff;
}

.btn-secondary {
    background: #1B2A4A;
    color: #ffffff;
}

.btn-secondary:hover {
    background: #2C3E6B;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(27, 42, 74, 0.3);
    text-decoration: none;
    color: #ffffff;
}

.btn-outline {
    background: transparent;
    color: #1B2A4A;
    border: 2px solid #1B2A4A;
}

.btn-outline:hover {
    background: #1B2A4A;
    color: #ffffff;
    transform: translateY(-2px);
    text-decoration: none;
}

.btn-success {
    background: #2E7D32;
    color: #ffffff;
}

.btn-success:hover {
    background: #1B5E20;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(46, 125, 50, 0.3);
    text-decoration: none;
    color: #ffffff;
}

.btn-danger {
    background: #8B0000;
    color: #ffffff;
}

.btn-danger:hover {
    background: #6B0000;
    transform: translateY(-2px);
    text-decoration: none;
    color: #ffffff;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 36px;
    font-size: 16px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ─── CARDS ──────────────────────────────────────────────────── */
.card {
    background: #ffffff;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: #1B2A4A;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ─── ALERTS ─────────────────────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: #ecfdf5;
    border: 1px solid #0ecb81;
    color: #065f46;
}

.alert-error {
    background: #fde8e8;
    border: 1px solid #f5c6c6;
    color: #8B0000;
}

.alert-warning {
    background: #fffbeb;
    border: 1px solid #f59e0b;
    color: #92400e;
}

.alert-info {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    color: #0d47a1;
}

/* ─── FORM ELEMENTS ─────────────────────────────────────────── */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #333;
    margin-bottom: 5px;
}

.form-group label .required {
    color: #8B0000;
    margin-left: 2px;
}

.form-group label .hint {
    font-weight: 400;
    color: #999;
    font-size: 11px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    background: #fafbfc;
    color: #1B2A4A;
    -webkit-appearance: none;
    appearance: none;
}

.form-control:focus {
    border-color: #8B0000;
    outline: none;
    box-shadow: 0 0 0 4px rgba(139, 0, 0, 0.08);
    background: #ffffff;
}

.form-control::placeholder {
    color: #94a3b8;
    font-size: 13px;
}

.form-control:disabled {
    background: #f0f0f0;
    cursor: not-allowed;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
    max-height: 200px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: #8B0000;
    cursor: pointer;
}

.form-check label {
    font-size: 13px;
    color: #475569;
    cursor: pointer;
    font-weight: 400;
}

.form-check label strong {
    color: #1B2A4A;
}

/* ─── TABLES ─────────────────────────────────────────────────── */
.table-container {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.table-container table {
    width: 100%;
    border-collapse: collapse;
}

.table-container th {
    text-align: left;
    padding: 14px 16px;
    font-size: 12px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
}

.table-container td {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    vertical-align: middle;
}

.table-container tr:hover {
    background: #fafbfc;
}

.table-container tr:last-child td {
    border-bottom: none;
}

/* ─── BADGES / STATUS ───────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

.badge-success {
    background: #e8f5e9;
    color: #2E7D32;
}

.badge-danger {
    background: #fde8e8;
    color: #8B0000;
}

.badge-warning {
    background: #fff3e0;
    color: #e65100;
}

.badge-info {
    background: #e3f2fd;
    color: #0d47a1;
}

.badge-secondary {
    background: #f0f0f0;
    color: #666;
}

/* ─── STATUS BADGES (Case Status) ──────────────────────────── */
.status-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
}

.status-badge.draft {
    background: #f0f0f0;
    color: #666;
}

.status-badge.pending_review {
    background: #fff3e0;
    color: #e65100;
}

.status-badge.reviewed {
    background: #e3f2fd;
    color: #0d47a1;
}

.status-badge.approved {
    background: #e8f5e9;
    color: #2E7D32;
}

.status-badge.completed {
    background: #e8f5e9;
    color: #1B5E20;
}

.status-badge.active {
    background: #e8f5e9;
    color: #2E7D32;
}

.status-badge.inactive {
    background: #fde8e8;
    color: #8B0000;
}

.status-badge.suspended {
    background: #fff3e0;
    color: #e65100;
}

/* ─── PAGINATION ─────────────────────────────────────────────── */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    text-decoration: none;
    color: #1B2A4A;
    font-size: 13px;
    transition: all 0.2s ease;
}

.pagination a:hover {
    background: #f0f0f0;
    text-decoration: none;
}

.pagination .active {
    background: #8B0000;
    color: #ffffff;
    border-color: #8B0000;
}

.pagination .active:hover {
    background: #a00000;
}

/* ─── GRID SYSTEM ───────────────────────────────────────────── */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* ─── UTILITY CLASSES ───────────────────────────────────────── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-muted { color: #666; }
.text-success { color: #2E7D32; }
.text-danger { color: #8B0000; }
.text-warning { color: #e65100; }
.text-info { color: #0d47a1; }

.font-weight-bold { font-weight: 700; }
.font-weight-semibold { font-weight: 600; }

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.p-1 { padding: 10px; }
.p-2 { padding: 20px; }
.p-3 { padding: 30px; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 10px; }
.gap-2 { gap: 20px; }
.flex-wrap { flex-wrap: wrap; }

.w-100 { width: 100%; }
.w-50 { width: 50%; }

.rounded { border-radius: 8px; }
.shadow { box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04); }

/* ─── RESPONSIVE ────────────────────────────────────────────── */

/* Tablets */
@media (max-width: 992px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .container { padding: 0 15px; }
}

/* Mobile */
@media (max-width: 600px) {
    .grid-4 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr; }
    .grid-2 { grid-template-columns: 1fr; }
    
    .card { padding: 15px; }
    
    .btn { padding: 8px 16px; font-size: 13px; }
    .btn-lg { padding: 12px 24px; font-size: 14px; }
    
    .table-container { overflow-x: auto; }
    .table-container th,
    .table-container td { padding: 10px 12px; font-size: 12px; }
    
    .pagination a,
    .pagination span { padding: 6px 10px; font-size: 12px; }
    
    .alert { padding: 10px 12px; font-size: 13px; }
    
    .form-control { padding: 8px 12px; font-size: 13px; }
}

/* Very Small Screens */
@media (max-width: 360px) {
    .card { padding: 12px; }
    .btn { font-size: 12px; padding: 6px 12px; }
    .table-container th,
    .table-container td { padding: 8px 10px; font-size: 11px; }
}

/* ─── ANIMATIONS ────────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

.slide-up {
    animation: slideUp 0.4s ease;
}

/* ─── LOADING SPINNER ───────────────────────────────────────── */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(139, 0, 0, 0.2);
    border-top-color: #8B0000;
    border-radius: 50%;
    animation: spin 0.8s ease-in-out infinite;
}

.spinner-white {
    border-color: rgba(255, 255, 255, 0.2);
    border-top-color: #ffffff;
}

/* ─── SIDEBAR (App Layout) ──────────────────────────────────── */
.sidebar {
    width: 240px;
    background: #1B2A4A;
    color: #ffffff;
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
    z-index: 100;
}

.sidebar .brand {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 20px;
}

.sidebar .brand h1 {
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
}

.sidebar .brand h1 span {
    color: #FFD700;
}

.sidebar .brand small {
    font-size: 11px;
    opacity: 0.5;
    display: block;
    color: #ffffff;
}

.sidebar .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
}

.sidebar .nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    text-decoration: none;
}

.sidebar .nav-item.active {
    background: rgba(139, 0, 0, 0.3);
    color: #ffffff;
    border-right: 3px solid #8B0000;
}

.sidebar .nav-item i {
    width: 20px;
    font-size: 16px;
    text-align: center;
}

.sidebar .nav-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin: 10px 20px;
}

.sidebar .user-info {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    position: absolute;
    bottom: 0;
    width: 100%;
}

.sidebar .user-info .name {
    font-weight: 600;
    font-size: 14px;
    color: #ffffff;
}

.sidebar .user-info .role {
    font-size: 12px;
    opacity: 0.5;
    color: #ffffff;
}

/* ─── MAIN CONTENT (App Layout) ────────────────────────────── */
.main-content {
    margin-left: 240px;
    padding: 30px;
    flex: 1;
    width: calc(100% - 240px);
    min-height: 100vh;
}

/* ─── RESPONSIVE SIDEBAR ────────────────────────────────────── */
@media (max-width: 992px) {
    .sidebar {
        width: 60px;
    }
    
    .sidebar .brand h1,
    .sidebar .brand small,
    .sidebar .nav-item span,
    .sidebar .user-info .name,
    .sidebar .user-info .role {
        display: none;
    }
    
    .sidebar .nav-item {
        padding: 12px;
        justify-content: center;
    }
    
    .sidebar .nav-item i {
        width: auto;
        font-size: 18px;
    }
    
    .sidebar .user-info {
        padding: 10px;
        text-align: center;
    }
    
    .main-content {
        margin-left: 60px;
        width: calc(100% - 60px);
        padding: 20px;
    }
}

@media (max-width: 600px) {
    .main-content {
        padding: 15px;
    }
}

/* ─── PRINT STYLES ──────────────────────────────────────────── */
@media print {
    .sidebar,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 20px !important;
    }
    
    body {
        background: #ffffff !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        page-break-inside: avoid;
    }
}