/* =====================
   ADMIN PANEL - COMPACT HEADER WITH SYSTEM INFO
   ===================== */

#adminPanel {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.95) 100%);
    backdrop-filter: blur(16px);
    z-index: 5000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

#adminPanel.active {
    display: flex;
}

.admin-panel {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 28px;
    padding: 20px;
    width: 95vw;
    height: 90vh;
    max-width: none;
    max-height: none;
    overflow: hidden;
    box-shadow: 
        0 30px 100px rgba(0, 0, 0, 0.5),
        0 15px 40px rgba(108, 92, 231, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.5);
    animation: slideInAdmin 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
}

/* Compact Header with System Info */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px dashed #e2e8f0;
    flex-shrink: 0;
    gap: 20px;
    height: 52px;
}

.admin-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.admin-header h2 {
    margin: 0;
    background: linear-gradient(135deg, #6C5CE7 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.4rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.5px;
    flex-shrink: 0;
    white-space: nowrap;
}

.admin-header h2 i {
    background: linear-gradient(135deg, #6C5CE7 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Compact System Info in Header */
.admin-header-info {
    display: flex;
    gap: 10px;
    flex: 1;
    justify-content: flex-end;
    align-items: center;
    height: 100%;
}

.header-info-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    transition: all 0.2s ease;
    height: 36px;
}

.header-info-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.header-info-item i {
    font-size: 1rem;
}

.header-info-item.xp i { color: #f59e0b; }
.header-info-item.games i { color: #22c55e; }
.header-info-item.badges i { color: #f97316; }
.header-info-item.theme i { color: #8b5cf6; }
.header-info-item.storage i { color: #06b6d4; }

.header-info-value {
    font-weight: 800;
    color: #1e293b;
}

/* Individual storage item styling */
.header-info-item.storage {
    padding: 6px 10px;
    gap: 6px;
}

.header-storage-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    min-width: 18px;
}

.header-storage-mini {
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-storage-bar {
    height: 8px;
    width: 40px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.header-storage-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.header-storage-fill.low { background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%); }
.header-storage-fill.medium { background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%); }
.header-storage-fill.high { background: linear-gradient(90deg, #f87171 0%, #ef4444 100%); }

.header-storage-percent {
    font-size: 0.9rem;
    font-weight: 700;
    color: #64748b;
    min-width: 28px;
    text-align: right;
}

.admin-close {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: white;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    flex-shrink: 0;
}

.admin-close:hover {
    transform: rotate(90deg) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.45);
}

/* 2x2 Grid Layout */
.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 16px;
    flex: 1;
    min-height: 0;
}

.admin-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 18px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.admin-section h3 {
    margin: 0 0 12px 0;
    color: #1e293b;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.admin-section h3 i {
    color: #6C5CE7;
    font-size: 0.9rem;
}

.admin-section-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Theme Selector - Card Style */
.theme-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 10px;
    flex: 1;
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    cursor: pointer;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    font-size: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.theme-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    transition: left 0.5s;
}

.theme-option:hover::before {
    left: 100%;
}

.theme-option:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 25px rgba(108, 92, 231, 0.2);
    border-color: #a78bfa;
}

.theme-option.active {
    background: linear-gradient(135deg, #6C5CE7 0%, #8b5cf6 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 10px 25px rgba(108, 92, 231, 0.35);
}

.theme-option.active:hover {
    transform: translateY(-3px) scale(1.02);
}

.theme-option i {
    display: block;
    font-size: 1.6rem;
    margin-bottom: 6px;
    transition: all 0.3s ease;
}

.theme-option:hover i {
    transform: scale(1.15) rotate(5deg);
}

.theme-option.active i {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Game Control - Card Style Buttons */
.admin-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 10px;
    flex: 1;
}

.admin-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    color: #334155;
    cursor: pointer;
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    font-size: 0.7rem;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.admin-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    transition: left 0.5s;
}

.admin-btn:hover::before {
    left: 100%;
}

.admin-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 25px rgba(108, 92, 231, 0.2);
    border-color: #a78bfa;
    color: white;
}

.admin-btn.danger {
    border-color: #fecaca;
    background: linear-gradient(135deg, #fef2f2 0%, #fff 100%);
}

.admin-btn.danger:hover {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: transparent;
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.35);
}

.admin-btn i {
    font-size: 1.4rem;
    margin-bottom: 6px;
    transition: all 0.3s ease;
}

.admin-btn:hover i {
    transform: scale(1.15) rotate(5deg);
}

.admin-btn span {
    text-align: center;
    line-height: 1.2;
}

/* Coming Soon Button Style */
.admin-btn.coming-soon {
    border-color: #cbd5e1;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #94a3b8;
    cursor: default;
    pointer-events: none;
}

.admin-btn.coming-soon i {
    color: #94a3b8;
}

.admin-btn.coming-soon:hover {
    transform: none;
    border-color: #cbd5e1;
    color: #94a3b8;
    box-shadow: none;
}

.admin-btn.coming-soon:hover i {
    transform: none;
}

/* Game Settings Section */
.game-settings-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px dashed #e2e8f0;
    border-radius: 14px;
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    padding: 20px;
}

.game-settings-content i {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #cbd5e1;
}

/* Game Settings Grid - 2x2 Layout */
.game-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 10px;
    width: 100%;
}

/* Setting Tile Styles */
.setting-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 8px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    transition: all 0.3s ease;
    min-width: 0;
    overflow: hidden;
}

.setting-tile:hover {
    border-color: #6C5CE7;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.15);
}

.setting-tile.disabled {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    opacity: 0.7;
}

.setting-tile-header {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #2d3436;
    white-space: nowrap;
}

.setting-tile-header i {
    font-size: 1rem;
    color: #6C5CE7;
}

.setting-tile-content {
    margin-bottom: 4px;
}

.setting-tile-desc {
    font-size: 0.65rem;
    color: #636e72;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Toggle Button Styles */
.toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 2px solid #dfe6e9;
    border-radius: 20px;
    background: white;
    color: #636e72;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    border-color: #6C5CE7;
    color: #6C5CE7;
}

.toggle-btn.active {
    background: linear-gradient(135deg, #6C5CE7 0%, #8b5cf6 100%);
    border-color: transparent;
    color: white;
}

.toggle-btn.toggle-btn-large {
    padding: 8px 16px;
    font-size: 0.8rem;
    min-width: 80px;
}

.toggle-btn.toggle-btn-large .toggle-icon {
    font-size: 1rem;
}

.toggle-btn.toggle-btn-large .toggle-text {
    font-size: 0.85rem;
    font-weight: 600;
}

.toggle-btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.toggle-btn.disabled:hover {
    border-color: #dfe6e9;
    color: #636e72;
}

/* Extra Feature Section */
.extra-features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 12px;
    flex: 1;
}

.extra-feature-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 10px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    color: #6C5CE7;
    cursor: pointer;
    font-family: 'Fredoka', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    min-height: 0;
}

.extra-feature-btn:hover {
    background: linear-gradient(135deg, #6C5CE7 0%, #8b5cf6 100%);
    color: white;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 25px rgba(108, 92, 231, 0.35);
    border-color: transparent;
}

.extra-feature-btn i {
    font-size: 1.6rem;
    transition: all 0.3s ease;
}

.extra-feature-btn:hover i {
    transform: scale(1.15);
}

/* Empty slot styling */
.extra-feature-btn--empty {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #94a3b8;
    border-style: dashed;
    cursor: default;
}

.extra-feature-btn--empty:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    color: #64748b;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
    border-color: #94a3b8;
}

.extra-features-list {
    display: none; /* Replaced by grid */
}

/* Custom Scrollbars */
.admin-grid::-webkit-scrollbar,
.extra-features-list::-webkit-scrollbar {
    width: 6px;
}

.admin-grid::-webkit-scrollbar-track,
.extra-features-list::-webkit-scrollbar-track {
    background: transparent;
}

.admin-grid::-webkit-scrollbar-thumb,
.extra-features-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #c4b5fd 0%, #a78bfa 100%);
    border-radius: 3px;
}

/* Animations */
@keyframes slideInAdmin {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 1400px) {
    .header-info-item .header-info-item span:not(.header-info-value):not(.header-storage-label):not(.header-storage-percent) {
        display: none;
    }
    
    .header-info-item {
        padding: 6px 10px;
    }
    
    .header-info-item.storage {
        padding: 6px 10px;
    }
}

@media (max-width: 1200px) {
    .admin-header-info .header-info-item span:not(.header-info-value):not(.header-storage-label):not(.header-storage-percent) {
        display: none;
    }
    
    .admin-header-info {
        gap: 8px;
    }
    
    .header-info-item {
        padding: 5px 8px;
        font-size: 0.7rem;
    }
    
    .header-info-item.storage {
        padding: 4px 6px;
    }
    
    .header-storage-bar {
        width: 30px;
        height: 6px;
    }
    
    .header-storage-percent {
        font-size: 0.9rem;
        min-width: 22px;
    }
}
