/* Admin Panel Styles */
:root {
    --admin-primary: #2c3e50;
    --admin-secondary: #34495e;
    --admin-accent: #3498db;
    --admin-success: #27ae60;
    --admin-warning: #f39c12;
    --admin-danger: #e74c3c;
    --admin-light: #ecf0f1;
    --admin-white: #ffffff;
}

body.admin-page {
    background: var(--admin-light);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Login Page */
.admin-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--admin-primary), var(--admin-accent));
    padding: 2rem;
}

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

.login-card h1 {
    text-align: center;
    color: var(--admin-primary);
    margin-bottom: 2rem;
}

.login-card .logo {
    text-align: center;
    font-size: 3rem;
    color: var(--admin-accent);
    margin-bottom: 1rem;
}

/* Admin Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background: var(--admin-primary);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 1000;
}

.admin-sidebar-header {
    padding: 1.5rem;
    background: var(--admin-secondary);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.admin-sidebar-header h2 {
    font-size: 1.25rem;
    margin: 0;
    color: white;
}

.admin-menu {
    list-style: none;
    padding: 1rem 0;
}

.admin-menu li {
    margin: 0.25rem 0;
}

.admin-menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s;
}

.admin-menu a:hover,
.admin-menu a.active {
    background: linear-gradient(135deg, var(--primary-color), #c0392b) !important;
    color: white;
    border-left: 3px solid var(--admin-accent);
}

.admin-menu i {
    width: 20px;
    text-align: center;
}

.admin-main {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
}

.admin-header {
    background: white;
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-header h1 {
    margin: 0;
    font-size: 1.75rem;
    color: var(--admin-primary);
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-content {
    padding: 2rem;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
}

.stat-icon.primary { background: var(--admin-accent); }
.stat-icon.success { background: var(--admin-success); }
.stat-icon.warning { background: var(--admin-warning); }
.stat-icon.danger { background: var(--admin-danger); }

.stat-info h3 {
    font-size: 2rem;
    margin: 0;
    color: var(--admin-primary);
}

.stat-info p {
    margin: 0;
    color: #666;
    font-size: 0.875rem;
}

/* Tables */
.admin-table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.table-header {
    padding: 1.5rem;
    background: var(--admin-primary);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

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

th, td {
    padding: 1rem;
    text-align: left;
}

th {
    background: var(--admin-light);
    font-weight: 600;
    color: var(--admin-primary);
}

tr:hover {
    background: #f8f9fa;
}

td {
    border-bottom: 1px solid var(--admin-light);
}

/* Buttons */
.btn-admin {
    padding: 0.5rem 1.25rem;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-admin-primary:hover {
    background: #2980b9;
}

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

.btn-admin-success:hover {
    background: #229954;
}

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

.btn-admin-danger:hover {
    background: #c0392b;
}

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

.btn-admin-secondary:hover {
    background: #2c3e50;
}

/* Forms */
.admin-form {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    padding: 2rem;
    overflow-y: auto;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    max-width: 800px;
    width: 100%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
}

.modal-close:hover {
    color: var(--admin-danger);
}

/* Responsive */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--admin-primary);
    cursor: pointer;
}

@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.active {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .table-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    table {
        font-size: 0.875rem;
    }

    th, td {
        padding: 0.75rem 0.5rem;
    }
}

/* Image preview */
.image-preview {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 5px;
}

.image-preview-large {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    margin: 1rem 0;
}
