@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #3498db;
    --primary-dark: #2980b9;
    --success: #2ecc71;
    --warning: #f1c40f;
    --purple: #9b59b6;
    --teal: #1abc9c;
    --teal-dark: #16a085;
    --dark: #2c3e50;
    --light-bg: #f8fafc;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --border-color: #e2e8f0;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 40px;
    background-color: var(--light-bg);
    color: #334155;
    font-size: 12px;
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

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

/* Header Navigation */
.header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.header-nav h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
}

.header-nav h2 a {
    color: var(--dark);
    text-decoration: none;
    transition: color 0.2s;
}

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

.nav-links {
    display: flex;
    gap: 15px;
}

.nav-link {
    padding: 8px 16px;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: #64748b;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.1);
}

.nav-link.active {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Stats Wrapper & Badges */
.stats-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    font-size: 11px;
    flex-wrap: wrap;
}

.stat-badge {
    padding: 4px 8px;
    border-radius: 4px;
    color: #333;
    border: 1px solid #ddd;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.stat-future { background-color: #fff9db; border-color: #fab005; }
.stat-today { background-color: #e7f5ff; border-color: #228be6; }
.stat-yesterday { background-color: #f1f3f5; border-color: #ced4da; }
.stat-2025 { background-color: #f8f0fc; color: #862e9c; border-color: #cc5de8; }
.stat-2026 { background-color: #ebfbee; color: #2b8a3e; border-color: #40c057; }
.stat-total { background-color: #3498db; color: white; border-color: #2980b9; }

/* Checkbox Wrappers */
.fav-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--purple);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #8e44ad;
    cursor: pointer;
    user-select: none;
    font-size: 12px;
    font-weight: bold;
}
.fav-checkbox-wrapper input { cursor: pointer; margin: 0; }

.pub-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--teal);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--teal-dark);
    cursor: pointer;
    user-select: none;
    font-size: 12px;
    font-weight: bold;
}
.pub-checkbox-wrapper input { cursor: pointer; margin: 0; }

/* Table Styling */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th, td {
    border: 1px solid var(--border-color);
    padding: 2px 4px;
    text-align: left;
    vertical-align: middle;
}

th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #475569;
}

th a {
    color: #2c3e50;
    text-decoration: none;
}

th a:hover {
    color: var(--primary);
    text-decoration: underline;
}

th.active-sort a {
    color: var(--primary);
    font-weight: bold;
}

.row-future { background-color: #fff9db !important; } 
.row-today { background-color: #ffe8cc !important; }  
.row-yesterday { background-color: #ebfbee !important; } 
.row-past { background-color: #ffffff; }               
tr:hover td { background-color: #f1f5f9 !important; } 

.app-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: block;
    object-fit: cover;
}

/* Links & Text Utilities */
a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* External Links */
a[href^="http://"],
a[href^="https://"] {
    color: #0038FF;
}

a[href^="http://"]:hover,
a[href^="https://"]:hover {
    color: #0022bb;
    text-decoration: underline;
}

.all-link {
    color: #e67e22;
    font-size: 12px;
    font-weight: bold;
}

.all-link:hover {
    color: #d35400;
    text-decoration: underline;
}

.fav-active-text { color: #000; font-weight: bold; font-size: 14px; cursor: default; }
.pub-active-text { color: #000; font-weight: bold; font-size: 14px; cursor: default; }
.rating-count-text { color: #7f8c8d; font-size: 11px; font-weight: normal; margin-left: 2px; }

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    gap: 15px;
}

.page-btn {
    padding: 10px 20px;
    background-color: var(--primary);
    color: white;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    transition: background-color 0.2s;
}

.page-btn:hover {
    background-color: var(--primary-dark);
    text-decoration: none;
}

.page-btn.disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    pointer-events: none;
}

.page-info {
    font-size: 15px;
    color: #7f8c8d;
    font-weight: bold;
}

/* Search Form Styling */
.search-container {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2px 4px 2px 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.search-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.search-input {
    border: none;
    outline: none;
    font-size: 13px;
    color: var(--dark);
    background: transparent;
    width: 150px;
    padding: 6px 0;
}

.search-btn {
    background-color: var(--primary);
    border: none;
    color: white;
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.search-btn:hover {
    background-color: var(--primary-dark);
}

.search-btn:active {
    transform: scale(0.97);
}

.clear-btn {
    color: #a0aec0;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.clear-btn:hover {
    color: #718096;
}

.genre-select {
    border: none;
    outline: none;
    font-size: 13px;
    color: var(--dark);
    background: transparent;
    padding: 6px 10px;
    border-left: 1px solid var(--border-color);
    margin-left: 10px;
    margin-right: 5px;
    cursor: pointer;
}

/* Form Styling (Add Developer Page) */
form label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--dark);
}

textarea {
    width: 100%;
    height: 150px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}

textarea:focus {
    border-color: var(--primary);
}

button[type="submit"] {
    padding: 10px 20px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

button[type="submit"]:hover {
    background-color: var(--primary-dark);
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-success {
    background-color: #ebfbee;
    color: #2b8a3e;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #fff5f5;
    color: #c92a2a;
    border: 1px solid #f5c6cb;
}

.id-link { color: var(--primary); }
.id-link:hover { text-decoration: underline; }
.date-text { color: #7f8c8d; font-family: monospace; font-size: 11px; }

/* Sub-navigation & Badges */
.year-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.year-link {
    padding: 6px 14px;
    border-radius: 20px;
    background-color: #fff;
    border: 1px solid var(--border-color);
    color: #64748b;
    font-weight: 600;
    font-size: 12.5px;
    transition: all 0.2s ease;
}

.year-link:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.year-link.active {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border: 1px solid transparent;
}

.badge-fav {
    background-color: #f3e8ff;
    color: #9b59b6;
    border-color: #e9d5ff;
}

.badge-pub {
    background-color: #ccfbf1;
    color: #1abc9c;
    border-color: #99f6e4;
}

.star-rating {
    font-weight: 700;
    color: #f59e0b;
}

/* KPIs and Dashboard Grids (Reports & Publisher Reports) */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.kpi-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s;
}

.kpi-card:hover {
    transform: translateY(-2px);
}

.kpi-title {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.kpi-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 5px;
}

.kpi-footer {
    font-size: 11px;
    color: #94a3b8;
}

.chart-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--card-shadow);
}

.chart-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.chart-wrapper {
    position: relative;
    height: 250px;
}

.data-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.data-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--card-shadow);
}

/* Sync Controls & Progress (Update Games Page) */
.sync-card {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.sync-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sync-desc {
    color: #64748b;
    margin-bottom: 25px;
    font-size: 13.5px;
}

.sync-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 30px;
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

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

.btn-primary:hover:not(:disabled) {
    background-color: var(--teal-dark);
    box-shadow: 0 4px 12px rgba(26, 188, 156, 0.2);
}

.btn-primary:disabled {
    background-color: #cbd5e1;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: #fff;
    border: 1px solid var(--border-color);
    color: #64748b;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-secondary:hover {
    border-color: #64748b;
    color: var(--dark);
}

.select-input {
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: #fff;
    color: var(--dark);
    font-weight: 600;
    font-size: 14px;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.select-input:hover {
    border-color: var(--primary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.stat-box {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.stat-label {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
}

.progress-wrapper {
    background-color: #e2e8f0;
    border-radius: 10px;
    height: 12px;
    overflow: hidden;
    position: relative;
    margin-bottom: 10px;
}

.progress-bar {
    background-color: var(--teal);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-percentage {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-align: right;
    margin-bottom: 25px;
}

.console-card {
    background-color: #0f172a;
    color: #38bdf8;
    padding: 20px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 12px;
    height: 250px;
    overflow-y: auto;
    border: 1px solid #1e293b;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.5);
}

.console-line {
    margin-bottom: 8px;
    line-height: 1.6;
}

.console-line strong {
    color: #f1f5f9;
}

.console-line.success {
    color: #4ade80;
}

.console-line.info {
    color: #38bdf8;
}

.console-line.warning {
    color: #fbbf24;
}

.console-line.error {
    color: #f87171;
}

/* Page Specific Styles: Add Dev */
.badge-pending { display: inline-block; padding: 3px 7px; background-color: #e67e22; color: white; border-radius: 4px; font-weight: bold; margin-left: 5px; transition: background 0.2s; }
.badge-pending:hover { background-color: #d35400; }
.badge-active { display: inline-block; padding: 3px 7px; background-color: #2ecc71; color: white; border-radius: 4px; font-weight: bold; margin-left: 5px; transition: background 0.2s; }
.badge-active:hover { background-color: #27ae60; }
.badge-fav { display: inline-block; padding: 3px 7px; background-color:#9b59b6; color: white; border-radius: 4px; font-weight: bold; margin-left: 5px; transition: background 0.2s; }
.badge-pub { display: inline-block; padding: 3px 7px; background-color:#1abc9c; color: white; border-radius: 4px; font-weight: bold; margin-left: 5px; transition: background 0.2s; }

.badge-link.active-filter .badge-active,
.badge-link.active-filter .badge-fav,
.badge-link.active-filter .badge-pub,
.badge-link.active-filter .badge-pending {
    background-color: #34495e !important;
}

.count-badge { display: inline-block; padding: 2px 6px; background-color: #2ecc71; color: white; border-radius: 4px; font-weight: bold; }
.count-badge.badge-all { background-color: #34495e; }
.count-zero { background-color: #95a5a6; }

button.btn-delete { background-color: #e74c3c; color: white; padding: 5px !important; border: none; border-radius: 4px; cursor: pointer; font-size: 11px; font-weight: bold; margin: 0; }
button.btn-delete:hover { background-color: #c0392b; }
button.btn-fav { background-color:#ecf0f1; color: #333; padding: 5px !important; border: none; border-radius: 4px; cursor: pointer; font-size: 11px; font-weight: bold; margin-right: 5px; border: 1px solid #bdc3c7; }
button.btn-fav:hover { background-color: #bdc3c7; }
button.btn-fav.is-fav { background-color: #9b59b6; color: white; }
button.btn-fav.is-fav:hover { background-color: #8e44ad; }

button.btn-pub { background-color: #ecf0f1; color: #333; padding: 5px !important; border: none; border-radius: 4px; cursor: pointer; font-size: 11px; font-weight: bold; margin-right: 5px; border: 1px solid #bdc3c7; }
button.btn-pub:hover { background-color: #bdc3c7; }
button.btn-pub.is-pub { background-color: #1abc9c; color: white; border: none; }
button.btn-pub.is-pub:hover { background-color: #16a085; }

.id-link { color: #2c3e50; font-weight: bold; text-decoration: none; }
.id-link:hover { color: #3498db; text-decoration: underline; }
.date-text { color: #7f8c8d; font-family: monospace; font-size: 11px; }

.back-btn { padding: 8px 15px; background-color: #34495e; color: white; border-radius: 4px; text-decoration: none; font-weight: bold; font-size: 12px; display: inline-block; transition: background-color 0.2s; }
.back-btn:hover { background-color: #2c3e50; text-decoration: none; }
