:root {
    --bg-main: #0c0e14;
    --bg-card: #141722;
    --bg-elevated: #1b2030;
    --bg-hover: #242a40;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --accent-glow: rgba(99, 102, 241, 0.25);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #23293e;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(16, 185, 129, 0.05) 0%, transparent 40%);
}

.app-wrapper {
    width: 100%;
    max-width: 1280px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-icon {
    font-size: 28px;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px var(--accent-glow);
}

.brand-text h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #ffffff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-text .tagline {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-elevated);
    padding: 6px 14px;
    border-radius: 30px;
    border: 1px solid var(--border);
}

.avatar {
    width: 28px;
    height: 28px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.username {
    font-size: 14px;
    font-weight: 600;
}

.role-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.role-admin { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); }
.role-uploader { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.role-registered { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }

.nav-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

.logout-btn {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}

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

/* Auth Cards */
.auth-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow);
}

.auth-toggle {
    display: flex;
    background: var(--bg-elevated);
    padding: 4px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.toggle-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-btn.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px var(--accent-glow);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

input {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.btn {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary { background: var(--accent); color: white; box-shadow: 0 4px 12px var(--accent-glow); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: #475569; color: white; }
.btn-secondary:hover { background: #334155; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); }
.btn-outline:hover { background: var(--bg-hover); color: white; }
.btn-block { width: 100%; }
.btn-small { padding: 6px 12px; font-size: 12px; }

.alert-box {
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    line-height: 1.4;
}

.alert-box.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.alert-box.success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 480px;
    width: 90%;
    box-shadow: var(--shadow);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.modal-header h2 { font-size: 20px; }
.modal-desc { color: var(--text-secondary); font-size: 14px; margin-bottom: 20px; line-height: 1.5; }

/* Content Cards */
.content-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow);
}

.info-card {
    text-align: center;
    max-width: 580px;
    margin: 40px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.info-icon { font-size: 48px; }
.info-card h2 { font-size: 22px; }
.info-card p { color: var(--text-secondary); font-size: 15px; }
.info-card .sub-info { font-size: 13px; color: var(--text-muted); }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 14px;
}

.card-header h2 { font-size: 20px; font-weight: 600; }
.card-header .subtitle { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

.badge-status {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

/* Admin Panel Layout */
.admin-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-label { font-size: 13px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 28px; font-weight: 700; color: #ffffff; }
.stat-sub { font-size: 13px; color: var(--text-secondary); }

.admin-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 { font-size: 17px; font-weight: 600; }
.table-legend { font-size: 13px; color: var(--text-muted); }

.admin-split {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
}

@media (max-width: 900px) {
    .admin-split { grid-template-columns: 1fr; }
}

/* Active Uploads Cards */
.active-uploads-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.active-upload-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auc-header {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 600;
}

.auc-user { color: var(--accent); font-size: 12px; }

.progress-bar-bg {
    background: #0f121d;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--success));
    transition: width 0.3s ease;
}

.auc-footer {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.data-table th {
    background: var(--bg-elevated);
    color: var(--text-muted);
    padding: 12px 14px;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
}

.compact-table td, .compact-table th { padding: 8px 10px; font-size: 13px; }

.select-role {
    background: var(--bg-elevated);
    color: white;
    border: 1px solid var(--border);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
}

/* Leaderboard */
.leaderboard-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.lb-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lb-rank {
    font-weight: 700;
    color: var(--accent);
    width: 20px;
}

.empty-state {
    color: var(--text-muted);
    font-size: 14px;
    padding: 16px;
    text-align: center;
}

/* Forzar la visualización de velocidad y tiempo restante en Uppy */
.uppy-Root .uppy-StatusBar-additionalInfo {
    display: block !important;
}
