/* Modern Admin Panel Styles */

:root {
    --primary: #dc2626; /* Red */
    --primary-dark: #b91c1c; /* Darker Red */
    --secondary: #000000; /* Black */
    --accent: #ffffff; /* White */
    --light: #ffffff; /* White */
    --dark: #000000; /* Black */
    --gray: #64748b; /* Gray */
    --success: #10b981; /* Green */
    --warning: #f59e0b; /* Amber */
    --danger: #ef4444; /* Red */
    
    --sidebar-bg: #000000; /* Black */
    --sidebar-hover: #333333; /* Dark Gray */
    --header-bg: white;
    --card-bg: white;
    
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --border-radius-sm: 8px;
    --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    --box-shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f1f5f9;
    color: var(--dark);
    min-height: 100vh;
}

/* Dark Mode Support */
[data-theme="dark"] {
    --light: #0f172a;
    --dark: #f8fafc;
    --gray: #cbd5e1;
    background-color: #0f172a;
    color: #f8fafc;
}

[data-theme="dark"] .card,
[data-theme="dark"] .login-card,
[data-theme="dark"] .modal-content {
    background-color: #1e293b;
    color: #f8fafc;
}

[data-theme="dark"] .table th {
    background-color: #1e293b;
}

[data-theme="dark"] .table tbody tr:hover {
    background-color: #334155;
}

[data-theme="dark"] .form-control {
    background-color: #1e293b;
    border-color: #334155;
    color: #f8fafc;
}

[data-theme="dark"] .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--secondary); /* Black background */
    padding: 20px;
}

/* Mobile Logo Optimization */
@media (max-width: 768px) {
    .logo-img-login {
        height: 40px;
    }
    
    .logo-img-sidebar {
        height: 25px;
    }
    
    .login-container {
        padding: 15px;
    }
    
    .login-card {
        padding: 30px 20px;
        margin: 10px;
    }
    
    .login-card h2 {
        font-size: 1.5rem;
    }
    
    .form-control {
        padding: 14px;
        font-size: 1rem;
    }
    
    .btn {
        padding: 14px;
        font-size: 1rem;
        width: 100%;
    }
}

.login-card {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow-lg);
    width: 100%;
    max-width: 450px;
    padding: 40px;
    text-align: center;
}

.login-logo {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.logo-img-login {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.login-card h2 {
    margin-bottom: 30px;
    color: var(--dark);
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #cbd5e1;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    width: 100%;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.4);
}

.alert {
    padding: 15px 20px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Dashboard Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: white;
    height: 100vh;
    position: fixed;
    overflow-y: auto;
    z-index: 100;
    box-shadow: var(--box-shadow-lg);
}

/* Bottom Navigation for Mobile */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--sidebar-bg);
    color: white;
    display: none;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.bottom-nav-menu {
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7);
    flex: 1;
    transition: all 0.3s ease;
}

.bottom-nav-item.active {
    color: white;
}

.bottom-nav-item i {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.bottom-nav-item span {
    font-size: 0.7rem;
    font-weight: 500;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.3s ease;
}

.sidebar-logo:hover {
    transform: scale(1.05);
}

.logo-img-sidebar {
    height: 30px;
    width: auto;
    object-fit: contain;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-item {
    margin-bottom: 5px;
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--primary), var(--accent));
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.nav-item:hover::before {
    transform: scaleY(1);
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #cbd5e1;
    text-decoration: none;
    transition: var(--transition);
    gap: 12px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.nav-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: 0.5s;
}

.nav-link:hover::after {
    left: 100%;
}

.nav-link:hover,
.nav-link.active {
    background-color: var(--sidebar-hover);
    color: white;
    transform: translateX(5px);
}

.nav-link i {
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    transition: var(--transition);
    padding-bottom: 60px; /* Space for bottom nav */
}

.main-content.mobile-view {
    margin-left: 0;
}

/* Header */
.admin-header {
    background-color: var(--header-bg);
    box-shadow: var(--box-shadow);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 99;
}

.header-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.dropdown {
    position: relative;
}

.dropdown-toggle {
    background: none;
    border: none;
    color: var(--dark);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    background-color: white;
    box-shadow: var(--box-shadow-lg);
    border-radius: var(--border-radius);
    padding: 10px 0;
    min-width: 200px;
    display: none;
    margin-top: 10px;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: var(--dark);
    text-decoration: none;
    gap: 10px;
    transition: var(--transition);
}

.dropdown-item:hover {
    background-color: #f1f5f9;
}

/* Content Area */
.content {
    padding: 30px;
}

.page-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.page-title h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--gray);
    font-size: 0.9rem;
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Cards */
.card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 25px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: var(--dark);
}

.card-body {
    padding: 25px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-lg);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.stat-card:hover .stat-icon {
    transform: scale(1.1);
}

.stat-icon.primary {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.stat-icon.success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stat-icon.warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.stat-icon.info {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--dark);
}

.stat-content p {
    color: var(--gray);
    margin: 0;
    font-size: 0.9rem;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--card-bg);
}

.table th,
.table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.table th {
    background-color: #f8fafc;
    font-weight: 600;
    color: var(--dark);
    font-size: 0.9rem;
    position: relative;
}

.table th::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background-color: #f8fafc;
    transform: scale(1.01);
}

.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.badge-secondary {
    background-color: rgba(148, 163, 184, 0.1);
    color: var(--gray);
}

/* Buttons */
.btn-sm {
    padding: 8px 15px;
    font-size: 0.875rem;
}

.btn-outline-primary {
    background-color: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    color: white;
}

.btn-outline-danger {
    background-color: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}

.btn-outline-danger:hover {
    background-color: var(--danger);
    color: white;
}

.btn-group {
    display: flex;
    gap: 8px;
}

/* Forms */
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.col-md-6 {
    flex: 1;
    min-width: 300px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #cbd5e1;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

/* Form Validation */
.form-control.valid {
    border-color: var(--success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.form-control.invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    display: none;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: var(--dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Reduced Animation Classes - Less Intensive */
.fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

.fade-out {
    animation: fadeOut 0.2s ease-out forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* Tooltip */
.tooltip {
    position: absolute;
    background-color: var(--dark);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    z-index: 1000;
    white-space: nowrap;
    animation: fadeIn 0.3s ease;
    box-shadow: var(--box-shadow);
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 992px) {
    .sidebar {
        width: 70px;
    }
    
    .sidebar .nav-link span {
        display: none;
    }
    
    .sidebar-header h2 span {
        display: none;
    }
    
    .main-content {
        margin-left: 70px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .bottom-nav {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .admin-header {
        padding: 15px;
    }
    
    .content {
        padding: 20px 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .col-md-6 {
        min-width: 100%;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    /* Mobile menu toggle - hide on mobile */
    .menu-toggle {
        display: none !important;
    }
}