:root {
    --bg-primary: #0a0b10;
    --bg-secondary: #12141e;
    --bg-card: #181b28;
    --accent-color: #00e5ff;
    --accent-hover: #33ebff;
    --danger-color: #ff0055;
    --danger-hover: #ff3377;
    --success-color: #00e676;
    --warning-color: #ffab00;
    --text-primary: #f0f3f8;
    --text-muted: #8e95a5;
    --border-color: #262a3d;
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
}

/* Navbar */
.admin-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 2.5rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 900;
}

.logo-text .highlight {
    color: var(--accent-color);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-portal {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-portal:hover {
    color: white;
    border-color: var(--accent-color);
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

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

/* Container */
.admin-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* Login Box */
.login-box {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.login-card h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
    color: var(--accent-color);
}

.login-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.8rem;
}

.input-group input {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    margin-bottom: 1.2rem;
    outline: none;
}

.input-group input:focus {
    border-color: var(--accent-color);
}

.btn-primary {
    background: var(--accent-color);
    color: #000;
    font-weight: 700;
    border: none;
    padding: 0.85rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    font-size: 1rem;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: #25293d;
    color: white;
    font-weight: 600;
    border: 1px solid var(--border-color);
    padding: 0.7rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #333852;
}

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.stat-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--accent-color);
    margin-bottom: 0.3rem;
}

.stat-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.badge-status {
    display: inline-block;
    padding: 0.35rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    margin: 0.4rem 0;
}

.badge-installed {
    background: rgba(0, 230, 118, 0.15);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.badge-missing {
    background: rgba(255, 0, 85, 0.15);
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

/* Card Sections */
.card-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.8rem;
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.section-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.section-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.2rem;
}

.section-desc code {
    background: #0a0b10;
    color: #ffab00;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
}

.inline-upload-form {
    display: flex;
    gap: 1rem;
    align-items: center;
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 8px;
    border: 1px dashed var(--border-color);
}

/* Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input, .form-group select {
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: white;
    font-size: 0.95rem;
    outline: none;
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--accent-color);
}

.field-hint {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.form-actions {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
}

.form-actions button {
    max-width: 250px;
}

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

.games-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

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

.games-table th {
    color: var(--text-muted);
    font-weight: 600;
    background: rgba(0, 0, 0, 0.2);
}

.games-table img {
    width: 48px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.btn-delete {
    background: transparent;
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

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

/* Progress */
.progress-container {
    margin-top: 1rem;
    background: var(--bg-secondary);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: var(--accent-color);
    transition: width 0.2s ease;
}

.progress-container span {
    position: relative;
    z-index: 2;
    font-size: 0.8rem;
    font-weight: 700;
    color: #000;
}

.feedback-msg {
    margin-top: 1rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.error-msg {
    color: var(--danger-color);
    margin-top: 0.8rem;
    font-size: 0.9rem;
}

.hidden {
    display: none !important;
}

/* ROMs Catalog Links Grid */
.roms-hub-card {
    border-color: rgba(255, 204, 0, 0.25);
    background: linear-gradient(180deg, rgba(255, 204, 0, 0.04) 0%, var(--bg-card) 100%);
}

.rom-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-top: 1.2rem;
}

.rom-link-item {
    display: block;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem 1.2rem;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.2s ease;
}

.rom-link-item:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 204, 0, 0.15);
}

.rom-link-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: var(--accent-color);
    margin-bottom: 0.4rem;
    font-weight: 700;
}

.rom-link-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.rom-link-item.highlight-link {
    border-color: rgba(79, 140, 255, 0.3);
    background: rgba(79, 140, 255, 0.05);
}

.rom-link-item.highlight-link:hover {
    border-color: #4f8cff;
    box-shadow: 0 4px 15px rgba(79, 140, 255, 0.2);
}

.rom-link-item.highlight-link .rom-link-title {
    color: #4f8cff;
}

/* Admin Filters Bar */
.admin-filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    background: var(--bg-secondary);
    padding: 1.2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
}

.filter-group input,
.filter-group select {
    padding: 0.65rem 0.9rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: #fff;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.filter-group input:focus,
.filter-group select:focus {
    border-color: var(--accent-color);
}

/* Action Buttons */
.table-actions-cell {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-edit {
    background: #4f8cff;
    color: #fff;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-edit:hover {
    background: #3b74db;
}

/* Edit Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    font-family: var(--font-heading);
    color: var(--accent-color);
    font-size: 1.25rem;
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.2rem 0.5rem;
    transition: color 0.2s;
}

.btn-close-modal:hover {
    color: #fff;
}


