/* Main CSS - Game-themed dark design */
:root {
    --primary-color: #4a90e2;
    --secondary-color: #7b68ee;
    --accent-color: #ff6b6b;
    --bg-dark: #1a1a2e;
    --bg-darker: #16213e;
    --bg-card: #0f3460;
    --text-primary: #eaeaea;
    --text-secondary: #b8b8b8;
    --border-color: #2a2a3e;
    --success-color: #51cf66;
    --warning-color: #ffd43b;
    --error-color: #ff6b6b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background: rgba(15, 52, 96, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--primary-color);
}

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

.btn {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

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

.btn-primary:hover {
    background: #357abd;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(74, 144, 226, 0.3);
}

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

.btn-secondary:hover {
    background: #6a5acd;
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
}

.btn-ghost:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

.btn-danger:hover {
    background: #e55555;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.3);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* File Upload */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    padding: 3rem;
    text-align: center;
    background: var(--bg-darker);
    transition: all 0.3s;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(74, 144, 226, 0.1);
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(74, 144, 226, 0.2);
}

.upload-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.folder-icon {
    --folder-icon-width: 56px;
    width: var(--folder-icon-width);
    height: calc(var(--folder-icon-width) * 0.72);
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(74, 144, 226, 0.6), rgba(123, 104, 238, 0.45));
    position: relative;
    display: inline-block;
    box-shadow: 0 15px 30px rgba(15, 52, 96, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.folder-icon::before {
    content: '';
    position: absolute;
    top: -28%;
    left: 8%;
    width: 60%;
    height: 45%;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.95), rgba(91, 163, 255, 0.7));
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.25);
}

.folder-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent);
}

.upload-icon .folder-icon {
    --folder-icon-width: 74px;
}

.folder-icon-inline {
    --folder-icon-width: 30px;
    margin-right: 0.5rem;
    transform: translateY(1px);
    box-shadow: 0 8px 14px rgba(15, 52, 96, 0.3);
}

.folder-entry {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: inherit;
}

.folder-entry .folder-name {
    font-weight: 600;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 10px;
    overflow: hidden;
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--bg-darker);
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.table tr:hover {
    background: rgba(74, 144, 226, 0.1);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.alert-success {
    background: rgba(81, 207, 102, 0.2);
    border: 1px solid var(--success-color);
    color: var(--success-color);
}

.alert-error {
    background: rgba(255, 107, 107, 0.2);
    border: 1px solid var(--error-color);
    color: var(--error-color);
}

.alert-info {
    background: rgba(74, 144, 226, 0.2);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 20, 0.75);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 2000;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.45);
    animation: modal-pop 0.2s ease-out;
}

@keyframes modal-pop {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(74, 144, 226, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

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

.badge-success {
    background: rgba(81, 207, 102, 0.2);
    color: var(--success-color);
}

.badge-warning {
    background: rgba(255, 212, 59, 0.2);
    color: var(--warning-color);
}

.badge-error {
    background: rgba(255, 107, 107, 0.2);
    color: var(--error-color);
}

.badge-info {
    background: rgba(74, 144, 226, 0.2);
    color: var(--primary-color);
}

.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    background: rgba(74, 144, 226, 0.15);
    border: 1px solid rgba(74, 144, 226, 0.4);
}

.role-icon {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    display: inline-block;
    background: var(--primary-color);
    box-shadow: 0 0 6px rgba(74, 144, 226, 0.8);
}

.role-badge--admin {
    background: rgba(255, 107, 107, 0.15);
    border-color: rgba(255, 107, 107, 0.5);
}

.role-icon--admin {
    background: var(--error-color);
    box-shadow: 0 0 6px rgba(255, 107, 107, 0.7);
}

.role-badge--coupon {
    background: rgba(81, 207, 102, 0.15);
    border-color: rgba(81, 207, 102, 0.5);
}

.role-icon--coupon {
    background: var(--success-color);
    box-shadow: 0 0 6px rgba(81, 207, 102, 0.7);
}

.role-badge--premium,
.role-badge--pro {
    background: rgba(123, 104, 238, 0.2);
    border-color: rgba(123, 104, 238, 0.5);
}

.role-icon--premium,
.role-icon--pro {
    background: var(--secondary-color);
}

.role-badge--free,
.role-badge--basic {
    background: rgba(255, 212, 59, 0.1);
    border-color: rgba(255, 212, 59, 0.4);
}

.role-icon--free,
.role-icon--basic {
    background: var(--warning-color);
    box-shadow: 0 0 6px rgba(255, 212, 59, 0.7);
}

.progress {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    height: 12px;
}

.progress-bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.4s ease;
}

.progress-bar.warning {
    background: linear-gradient(90deg, var(--warning-color), #ff922b);
}

.progress-bar.danger {
    background: linear-gradient(90deg, var(--error-color), #c92a2a);
}

.storage-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

/* Storage settings inline forms (storage_stats.html) */
.storage-form-inline {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 1rem;
    align-items: flex-end;
}

@media (max-width: 768px) {
    .storage-form-inline {
        grid-template-columns: 1fr;
    }
}

.summary-tile {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.summary-tile h3 {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.summary-value {
    font-size: 1.4rem;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
}

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

