/* Professional Admin Panel Styling */

/* Admin Container */
#admin {
    --admin-bg: var(--bg);
    --admin-surface: var(--surface);
    --admin-border: var(--border);
    --admin-text: var(--text);
    --admin-muted: var(--muted);
    --admin-accent: var(--green);
    --admin-gold: var(--gold);
}

html[data-theme="dark"] #admin {
    --admin-bg: var(--dark-bg);
    --admin-surface: var(--dark-surface2);
    --admin-border: rgba(255, 255, 255, 0.1);
    --admin-text: #fff;
    --admin-muted: rgba(255, 255, 255, 0.6);
}

/* Admin Header */
#adminTitle {
    font-size: 24px;
    font-weight: 700;
    color: var(--admin-text);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

#adminTitle::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, var(--admin-accent), var(--admin-gold));
    border-radius: 2px;
}

/* Admin Navigation Tabs - Disabled horizontal tabs style because it overrides and breaks the vertical sidebar menu (#adminNav) */
/*
#adminNav {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--admin-border);
    overflow-x: auto;
    padding-bottom: 12px;
}

#adminNav button {
    padding: 10px 16px;
    background: transparent;
    border: none;
    color: var(--admin-muted);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    white-space: nowrap;
}

#adminNav button:hover {
    color: var(--admin-text);
    border-bottom-color: var(--admin-accent);
}

#adminNav button.active {
    color: var(--admin-accent);
    border-bottom-color: var(--admin-accent);
}
*/

/* Admin Content Area */
#adminContent {
    background: var(--admin-surface);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--admin-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

html[data-theme="dark"] #adminContent {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Admin Cards */
.admin-card {
    background: var(--admin-bg);
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 16px;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.admin-card:hover {
    border-color: var(--admin-accent);
    box-shadow: 0 8px 24px rgba(15, 107, 61, 0.1);
}

.admin-card h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--admin-text);
    margin: 0 0 12px;
}

.admin-card p {
    font-size: 14px;
    color: var(--admin-muted);
    margin: 0;
    line-height: 1.5;
}

/* Admin Stats Grid */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.admin-stat-card {
    background: linear-gradient(135deg, var(--admin-accent), var(--admin-accent) 50%, rgba(15, 107, 61, 0.8));
    color: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(15, 107, 61, 0.2);
}

.admin-stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.admin-stat-card .stat-label {
    font-size: 13px;
    opacity: 0.9;
    font-weight: 600;
}

/* Admin Form Elements */
.admin-form-group {
    margin-bottom: 18px;
}

.admin-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--admin-text);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-form-group input,
.admin-form-group textarea,
.admin-form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--admin-border);
    border-radius: 8px;
    background: var(--admin-bg);
    color: var(--admin-text);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-sizing: border-box;
}

.admin-form-group input:focus,
.admin-form-group textarea:focus,
.admin-form-group select:focus {
    outline: none;
    border-color: var(--admin-accent);
    background: var(--admin-surface);
    box-shadow: 0 0 0 3px rgba(15, 107, 61, 0.1);
}

.admin-form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: 'Courier New', monospace;
}

/* Admin Buttons */
.admin-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-btn-primary {
    background: linear-gradient(135deg, var(--admin-accent), #1a8659);
    color: white;
    box-shadow: 0 4px 12px rgba(15, 107, 61, 0.3);
}

.admin-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15, 107, 61, 0.4);
}

.admin-btn-primary:active {
    transform: translateY(0);
}

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

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

.admin-btn-danger {
    background: #dc2626;
    color: white;
}

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

.admin-btn-ghost {
    background: transparent;
    color: var(--admin-accent);
    border: 2px solid var(--admin-accent);
}

.admin-btn-ghost:hover {
    background: rgba(15, 107, 61, 0.1);
}

/* Admin Table */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.admin-table thead {
    background: var(--admin-accent);
    color: white;
}

.admin-table th {
    padding: 12px 14px;
    text-align: left;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--admin-border);
    font-size: 14px;
}

.admin-table tbody tr:hover {
    background: rgba(15, 107, 61, 0.05);
}

.admin-table tbody tr[draggable="true"] {
    cursor: move;
}

.admin-table tbody tr[draggable="true"]:hover {
    background: rgba(15, 107, 61, 0.1);
    opacity: 0.8;
}

/* Admin Modal */
.admin-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.admin-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.admin-modal-content {
    background: var(--admin-surface);
    border-radius: 16px;
    padding: 32px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

/* Admin Notifications */
.admin-notification {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.admin-notification-success {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border-left: 4px solid #22c55e;
}

.admin-notification-error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-left: 4px solid #ef4444;
}

.admin-notification-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border-left: 4px solid #f59e0b;
}

.admin-notification-info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-left: 4px solid #3b82f6;
}

/* Admin Sidebar (Optional) */
.admin-sidebar {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: var(--admin-surface);
    border-right: 1px solid var(--admin-border);
    padding: 20px;
    overflow-y: auto;
    z-index: 99998;
}

@media (min-width: 1024px) {
    .admin-sidebar {
        display: block;
    }
    
    /* Disabled margin-left: 280px on #admin because #admin contains the vertical sidebar itself.
       Shifting #admin shifts the whole dashboard layout to the middle. */
    /*
    #admin {
        margin-left: 280px;
    }
    */
}

.admin-sidebar-item {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    color: var(--admin-muted);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.admin-sidebar-item:hover,
.admin-sidebar-item.active {
    background: var(--admin-accent);
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    #adminNav {
        flex-wrap: wrap;
    }
    
    .admin-stats {
        grid-template-columns: 1fr;
    }
    
    .admin-modal-content {
        padding: 20px;
    }
}
