/**
 * Admin Dashboard Stylesheet
 * Bootstrap 5 + Custom Styles
 */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    overflow-x: hidden;
}

/* ========== NAVBAR ========== */
.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0a58ca 100%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1rem 1.5rem;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: white !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-brand i {
    font-size: 1.8rem;
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    margin: 0 10px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: white !important;
    transform: translateY(-2px);
}

.navbar-nav .nav-link.active {
    color: white !important;
    border-bottom: 3px solid white;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    color: white;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 0.9rem;
}

/* ========== SIDEBAR ========== */
.sidebar {
    background-color: white;
    border-right: 1px solid #e9ecef;
    min-height: calc(100vh - 60px);
    padding: 20px 0;
    position: sticky;
    top: 60px;
}

.sidebar .nav-link {
    color: #495057;
    padding: 12px 20px;
    margin: 5px 0;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.sidebar .nav-link:hover {
    color: var(--primary-color);
    background-color: #f8f9fa;
    border-left-color: var(--primary-color);
}

.sidebar .nav-link.active {
    color: var(--primary-color);
    background-color: #f0f6ff;
    border-left-color: var(--primary-color);
    font-weight: 600;
}

.sidebar-title {
    padding: 15px 20px;
    font-weight: 700;
    color: var(--dark-color);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

/* ========== STATISTICS CARDS ========== */
.stats-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-left: 4px solid;
}

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

.stats-card.primary {
    border-left-color: var(--primary-color);
}

.stats-card.success {
    border-left-color: var(--success-color);
}

.stats-card.danger {
    border-left-color: var(--danger-color);
}

.stats-card.warning {
    border-left-color: var(--warning-color);
}

.stats-card.info {
    border-left-color: var(--info-color);
}

.stats-card-title {
    font-size: 0.9rem;
    color: #6c757d;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-card-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark-color);
}

.stats-card-subtitle {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 10px;
}

.stats-card-icon {
    position: absolute;
    right: 25px;
    top: 25px;
    font-size: 2rem;
    opacity: 0.1;
}

/* ========== LOGIN PAGE ========== */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, #0a58ca 100%);
}

.login-card {
    background: white;
    border-radius: 15px;
    padding: 50px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-card h2 {
    text-align: center;
    margin-bottom: 10px;
    color: var(--dark-color);
    font-weight: 700;
}

.login-card .subtitle {
    text-align: center;
    color: #6c757d;
    margin-bottom: 30px;
    font-size: 0.95rem;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark-color);
    font-size: 0.95rem;
}

.login-form .form-control {
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.login-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.login-form .btn-login {
    width: 100%;
    padding: 12px;
    font-weight: 600;
    border-radius: 8px;
    margin-top: 10px;
}

.login-form .remember-me {
    margin-bottom: 20px;
}

.login-form .remember-me input {
    margin-right: 8px;
}

/* ========== TABLES ========== */
.table-responsive {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.table {
    margin: 0;
    font-size: 0.95rem;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    font-weight: 600;
    color: var(--dark-color);
    padding: 15px;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table tbody td {
    vertical-align: middle;
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

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

/* ========== BADGES & PILLS ========== */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-block;
}

/* ========== MODALS ========== */
.modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0a58ca 100%);
    color: white;
    border: none;
    padding: 20px;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

/* ========== BUTTONS ========== */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #0b5ed7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

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

.btn-outline-primary {
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

/* ========== PAGINATION ========== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin: 30px 0 0 0;
}

.page-item .page-link {
    border-radius: 6px;
    border: 1px solid #e9ecef;
    color: var(--primary-color);
    padding: 8px 12px;
    transition: all 0.3s ease;
}

.page-item .page-link:hover:not(.page-item.active .page-link) {
    background-color: #f8f9fa;
    color: #0b5ed7;
}

.page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* ========== CHARTS ========== */
.chart-container {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chart-title {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

/* ========== ACTIVITY FEED ========== */
.activity-item {
    transition: all 0.3s ease;
    border-radius: 8px;
    background-color: white;
}

.activity-item:hover {
    background-color: #f8f9fa;
}

.activity-item .badge {
    margin-left: auto;
}

/* ========== FILTERS ========== */
.filter-section {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.filter-section .form-control {
    border-radius: 8px;
    border: 1px solid #e9ecef;
    padding: 10px 15px;
}

.filter-section .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* ========== ALERTS & TOASTS ========== */
.alert {
    border: none;
    border-radius: 8px;
    padding: 15px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#toastContainer {
    z-index: 9999;
}

/* ========== SPINNER ========== */
.spinner-border {
    color: var(--primary-color);
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 768px) {
    .sidebar {
        position: absolute;
        width: 250px;
        z-index: 100;
        left: -250px;
        transition: left 0.3s ease;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    }

    .sidebar.show {
        left: 0;
    }

    .navbar {
        padding: 1rem;
    }

    .navbar-brand {
        font-size: 1.2rem;
    }

    .stats-card {
        padding: 15px;
    }

    .stats-card-value {
        font-size: 1.8rem;
    }

    .stats-card-icon {
        font-size: 1.5rem;
    }

    .login-card {
        padding: 30px 20px;
        max-width: 90%;
    }

    .table {
        font-size: 0.85rem;
    }

    .table thead th,
    .table tbody td {
        padding: 10px;
    }

    .btn-sm {
        padding: 4px 8px;
        font-size: 0.75rem;
    }

    .user-menu {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .user-info {
        align-items: flex-start;
    }
}

@media (max-width: 576px) {
    .stats-card {
        padding: 10px;
        margin-bottom: 10px;
    }

    .stats-card-value {
        font-size: 1.5rem;
    }

    .navbar {
        padding: 0.5rem;
    }

    .login-card {
        padding: 20px 15px;
    }

    .login-card h2 {
        font-size: 1.5rem;
    }

    .table {
        font-size: 0.8rem;
    }

    .badge {
        padding: 4px 8px;
        font-size: 0.75rem;
    }

    .btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}

/* ========== DARK MODE SUPPORT (Optional) ========== */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }

    .navbar {
        background: linear-gradient(135deg, #0d47a1 0%, #0a3d91 100%);
    }

    .sidebar,
    .stats-card,
    .table-responsive,
    .chart-container,
    .filter-section,
    .login-card {
        background-color: #2a2a2a;
        color: #e0e0e0;
    }

    .sidebar .nav-link {
        color: #b0b0b0;
    }

    .sidebar .nav-link:hover {
        background-color: #333;
    }

    .table thead th {
        background-color: #333;
        color: #e0e0e0;
    }

    .table tbody td {
        border-bottom-color: #444;
    }

    .table tbody tr:hover {
        background-color: #333;
    }

    .form-control {
        background-color: #333;
        border-color: #444;
        color: #e0e0e0;
    }

    .form-control:focus {
        background-color: #333;
        border-color: var(--primary-color);
        color: #e0e0e0;
    }
}
