/* ── Reset & Base ─────────────────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a1a;
    color: #e0e0e0;
}

/* ── Login ────────────────────────────────────────────────────────────────── */
.login-container {
    max-width: 500px;
    margin: 100px auto;
    padding: 40px;
    background: #2a2a2a;
    border-radius: 8px;
    text-align: center;
}

.login-container h1 {
    margin-bottom: 20px;
    color: #FFD700;
}

.login-container p {
    color: #aaa;
    margin-bottom: 24px;
}

/* ── Layout shell ─────────────────────────────────────────────────────────── */
.upload-container {
    max-width: 900px;
    margin: 20px auto;
    background: #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.chat-header {
    background: #1e1e1e;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #FFD700;
}

.server-info { display: flex; align-items: center; gap: 15px; }
.server-info h2 { color: #FFD700; font-size: 1.2em; }

.user-info { display: flex; align-items: center; gap: 10px; }

.avatar { width: 32px; height: 32px; border-radius: 4px; }

.btn-logout {
    padding: 5px 12px;
    background: #444;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9em;
}
.btn-logout:hover { background: #555; }

.btn-admin {
    padding: 5px 12px;
    background: #FFD700;
    color: #1a1a1a;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: bold;
}
.btn-admin:hover { background: #FFC700; }

/* ── Upload body ──────────────────────────────────────────────────────────── */
.upload-body {
    padding: 24px 28px;
}

/* ── Quota badge ──────────────────────────────────────────────────────────── */
.upload-quota { margin-bottom: 20px; }

.quota-badge {
    display: inline-block;
    padding: 6px 14px;
    background: #252525;
    border: 1px solid #444;
    border-radius: 4px;
    font-size: 0.9em;
    color: #aaa;
}
.quota-badge.whitelisted { border-color: #4CAF50; color: #4CAF50; }
.quota-badge.quota-full  { border-color: #f44336; color: #f44336; }

/* ── Form sections ────────────────────────────────────────────────────────── */
.form-section { margin-bottom: 24px; }

.section-label {
    display: block;
    font-weight: 600;
    color: #FFD700;
    margin-bottom: 12px;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Upload type cards ────────────────────────────────────────────────────── */
.type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.type-option { cursor: pointer; }
.type-option input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; }

.type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 12px;
    background: #252525;
    border: 2px solid #444;
    border-radius: 6px;
    transition: border-color 0.15s, background 0.15s;
    text-align: center;
    user-select: none;
}

.type-card:hover { border-color: #888; background: #2e2e2e; }
.type-card.checked { border-color: #FFD700; background: #2d2800; }

.type-icon { font-size: 1.8em; }
.type-name { font-weight: 600; font-size: 0.95em; color: #e0e0e0; }
.type-hint { font-size: 0.78em; color: #888; }

/* ── File drop zone ───────────────────────────────────────────────────────── */
.file-drop-zone {
    position: relative;
    border: 2px dashed #444;
    border-radius: 6px;
    padding: 36px 20px;
    text-align: center;
    background: #1e1e1e;
    transition: border-color 0.15s, background 0.15s;
    cursor: pointer;
}

.file-drop-zone:hover,
.file-drop-zone.drag-over {
    border-color: #FFD700;
    background: #211f00;
}

.file-drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.drop-hint { display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.drop-icon { font-size: 2em; }
.drop-sub  { font-size: 0.8em; color: #666; }

.file-selected {
    font-size: 0.95em;
    color: #FFD700;
    word-break: break-all;
    pointer-events: none;
}

/* ── Progress ─────────────────────────────────────────────────────────────── */
.progress-wrap {
    height: 24px;
    background: #252525;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    width: 0;
    background: #FFD700;
    transition: width 0.1s;
}

.progress-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    color: #1a1a1a;
    font-weight: bold;
}

/* ── Messages ─────────────────────────────────────────────────────────────── */
.upload-message {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 0.95em;
}
.msg-success { background: #1a3a1a; border-left: 3px solid #4CAF50; color: #81c784; }
.msg-error   { background: #3d1f1f; border-left: 3px solid #f44336; color: #ef9a9a; }

/* ── Submit button ────────────────────────────────────────────────────────── */
.send-btn {
    padding: 11px 28px;
    background: #FFD700;
    color: #1a1a1a;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1em;
    transition: background 0.15s;
}
.send-btn:hover:not(:disabled) { background: #FFC700; }
.send-btn:disabled { background: #555; color: #888; cursor: not-allowed; }

.upload-submit { display: block; width: 100%; }

/* ── Recent uploads table ─────────────────────────────────────────────────── */
.recent-uploads { margin-top: 32px; }

.uploads-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}
.uploads-table th {
    text-align: left;
    padding: 10px 12px;
    background: #1e1e1e;
    color: #FFD700;
    border-bottom: 2px solid #333;
    font-weight: 600;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.uploads-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #333;
    vertical-align: middle;
}
.uploads-table tr:hover td { background: #252525; }

.file-cell {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: monospace;
    font-size: 0.9em;
}

.status-pill {
    font-weight: 600;
    font-size: 0.85em;
}

/* ── Admin stats ──────────────────────────────────────────────────────────── */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: #1e1e1e;
    border: 2px solid #333;
    border-radius: 6px;
    padding: 16px;
    text-align: center;
}
.stat-label { font-size: 0.8em; color: #888; margin-bottom: 6px; }
.stat-value { font-size: 1.8em; font-weight: bold; }

/* ── Admin actions ────────────────────────────────────────────────────────── */
.admin-actions { margin-bottom: 16px; }

.process-output {
    margin-top: 12px;
    padding: 12px 16px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85em;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 200px;
    overflow-y: auto;
}

/* ── Admin table ──────────────────────────────────────────────────────────── */
.admin-table .action-cell { white-space: nowrap; }

.action-btn {
    padding: 4px 10px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.82em;
    font-weight: 600;
    margin-right: 4px;
    transition: opacity 0.15s;
}
.action-btn:hover { opacity: 0.8; }
.btn-approve { background: #4CAF50; color: #fff; }
.btn-reject  { background: #f44336; color: #fff; }
.btn-delete  { background: #333; color: #aaa; }

.steam-name { color: #e0e0e0; font-weight: 500; }

/* ── Server tabs (reused for admin filter) ────────────────────────────────── */
.server-tabs {
    display: flex;
    background: #1e1e1e;
    border-bottom: 2px solid #333;
    overflow-x: auto;
}

.tab-btn {
    flex: 1;
    min-width: 100px;
    padding: 12px 16px;
    background: #252525;
    border: none;
    border-right: 1px solid #333;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    font-size: 0.9em;
}
.tab-btn:hover { background: #2a2a2a; color: #e0e0e0; }
.tab-btn.active { background: #1a1a1a; color: #FFD700; border-bottom: 2px solid #FFD700; }

.tab-badge {
    background: #f44336;
    color: #fff;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

/* ── Animations ───────────────────────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .upload-body { padding: 16px; }
    .type-grid   { grid-template-columns: repeat(2, 1fr); }
    .admin-stats { grid-template-columns: repeat(2, 1fr); }
    .chat-header { flex-direction: column; gap: 10px; align-items: flex-start; }
    .uploads-table th:nth-child(3),
    .uploads-table td:nth-child(3) { display: none; } /* hide user col on mobile */
}
