/* Admin Panel CSS */

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --bottom-nav-height: 60px;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    max-width: 420px;
    width: 100%;
}

.login-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.login-header i {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}

.login-body {
    padding: 40px 30px;
}

.btn-login {
    background: var(--primary-gradient);
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-weight: 600;
}

/* Main Content */
.main-content {
    margin-top: 70px;
    min-height: calc(100vh - 70px);
    padding-bottom: 80px;
    /* Space for footer/bottom nav */
}

/* Desktop Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-weight: 600;
}

/* Stats Cards */
.stats-card {
    border-radius: var(--radius-md);
    padding: 1.5rem;
    color: white;
    transition: transform 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
}

.stats-card.bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.stats-card.bg-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%) !important;
}

.stats-card.bg-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
}

.stats-card.bg-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
}

.stats-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

.stats-value {
    font-size: 2rem;
    font-weight: 700;
}

.stats-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Table */
.table-container {
    background: white;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.table thead th {
    background: #f8f9fa;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    color: #6c757d;
}

/* Filter Section */
.filter-section {
    background: white;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

/* Page Header */
.page-title {
    font-weight: 700;
    color: #212529;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: #6c757d;
    font-size: 0.875rem;
}

/* Action Buttons */
.action-buttons .btn {
    margin: 0 2px;
}

.btn-action {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    opacity: 0.3;
    margin-bottom: 1rem;
    display: block;
}

/* Form Controls */
.form-control,
.form-select {
    border-radius: var(--radius-sm);
}

.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

/* Modal */
.modal-content {
    border: none;
    border-radius: var(--radius-md);
}

/* ==================== BOTTOM NAV (Mobile) ==================== */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 8px 0;
    padding-bottom: env(safe-area-inset-bottom, 8px);
}

.bottom-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
}

.bottom-nav-item {
    flex: 1;
    text-align: center;
}

.bottom-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    color: #6c757d;
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 8px;
    margin: 0 4px;
}

.bottom-nav-link i {
    font-size: 1.5rem;
    margin-bottom: 2px;
}

.bottom-nav-link span {
    font-size: 0.65rem;
    font-weight: 500;
}

.bottom-nav-link.active {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.bottom-nav-link:hover {
    color: #667eea;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 991px) {

    /* Hide desktop footer on mobile */
    .footer {
        display: none;
    }

    /* Show bottom nav on mobile */
    .bottom-nav {
        display: block;
    }

    /* Adjust main content padding for bottom nav */
    .main-content {
        padding-bottom: calc(var(--bottom-nav-height) + 20px);
    }

    /* Navbar adjustments */
    .navbar-brand {
        font-size: 1rem;
    }

    #dbSwitcher {
        max-width: 120px;
        font-size: 0.75rem;
    }
}

@media (max-width: 768px) {

    /* Page header */
    .page-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }

    .page-header .btn-group,
    .page-header .btn {
        width: 100%;
        margin-top: 0.5rem;
    }

    /* Stats cards */
    .stats-card {
        margin-bottom: 1rem;
        padding: 1rem;
    }

    .stats-value {
        font-size: 1.5rem;
    }

    .stats-icon {
        font-size: 2rem;
    }

    /* Table */
    .table-container {
        padding: 0.75rem;
        overflow-x: auto;
    }

    .table {
        font-size: 0.8rem;
    }

    .action-buttons .btn {
        padding: 0.2rem 0.35rem;
        font-size: 0.7rem;
    }

    /* Filter section */
    .filter-section {
        padding: 1rem;
    }

    .filter-section .form-label {
        font-size: 0.8rem;
    }

    /* Cards */
    .card-body {
        padding: 1rem;
    }

    /* Login */
    .login-card {
        margin: 15px;
    }

    .login-header {
        padding: 30px 20px;
    }

    .login-body {
        padding: 25px 20px;
    }

    /* Hide some columns on mobile for better fit */
    .hide-mobile {
        display: none !important;
    }
}

@media (max-width: 576px) {

    /* Extra small screens */
    .navbar {
        padding: 0.5rem;
    }

    .navbar-brand {
        font-size: 0.9rem;
    }

    .navbar-brand i {
        display: none;
    }

    .main-content {
        margin-top: 60px;
    }

    /* Tables - make responsive */
    .table-responsive {
        margin: 0 -0.75rem;
    }

    /* Stats smaller */
    .stats-value {
        font-size: 1.25rem;
    }

    .stats-label {
        font-size: 0.7rem;
    }

    /* Bottom nav adjustments */
    .bottom-nav-link i {
        font-size: 1.25rem;
    }

    .bottom-nav-link span {
        font-size: 0.6rem;
    }
}