/*
Theme Name: SwitchROMs Pro
Theme URI: https://switchroms.com
Author: SwitchROMs Team
Author URI: https://switchroms.com
Description: Premium Nintendo Switch ROMs theme with modern UI
Version: 3.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: switchroms
*/

/* ========== VARIABLES ========== */
:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --accent: #10b981;
    --accent-hover: #059669;
    --dark: #0f172a;
    --dark-2: #1e293b;
    --text: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --font-head: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Inter', sans-serif;
    --radius: 10px;
    --radius-sm: 8px;
    --radius-lg: 14px;
    --shadow: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 20px rgba(0,0,0,0.08);
}

/* ========== RESET ========== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }

/* ========== LAYOUT ========== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.site-main { padding: 24px 0 40px; }

/* ========== HEADER ========== */
.main-header {
    background: var(--dark);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.main-header .container {
    display: flex;
    align-items: center;
    height: 56px;
    gap: 1.5rem;
}

.logo {
    font-family: var(--font-head);
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.3px;
    white-space: nowrap;
}
.logo span { color: var(--primary); }

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.nav-pill {
    padding: 6px 14px;
    color: #94a3b8;
    font-size: 0.82rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.15s ease;
}
.nav-pill:hover { color: #e2e8f0; background: rgba(255,255,255,0.06); }

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.search-box {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: all 0.2s ease;
}
.search-box:focus-within { background: rgba(255,255,255,0.12); border-color: var(--primary); }

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    padding: 7px 12px;
    font-size: 0.82rem;
    width: 180px;
    font-family: var(--font-body);
}
.search-box input::placeholder { color: #64748b; }

.search-box button {
    background: var(--primary);
    border: none;
    color: #fff;
    padding: 7px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    transition: all 0.15s ease;
}
.search-box button:hover { background: var(--primary-hover); }

.mobile-btn {
    display: none;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 1.2rem;
}

/* ========== SECTION HEADERS ========== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 16px;
}
.section-header h2 {
    font-family: var(--font-head);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}
.section-header .view-all {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
}
.section-header .view-all:hover { color: var(--primary-hover); }

/* ========== FEATURED HERO (removed - clean grid only) ========== */

/* ========== ROM CARDS ========== */
.rom-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

.rom-card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.15s ease;
}
.rom-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.rom-card a { display: block; color: inherit; }

.rom-card__image {
    aspect-ratio: 3/4;
    overflow: hidden;
    background: #f1f5f9;
}
.rom-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rom-card__body {
    padding: 8px 10px 10px;
}

.rom-card__body h3 {
    font-family: var(--font-head);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
}

.rom-card__meta {
    font-size: 0.68rem;
    color: var(--text-muted);
    letter-spacing: 0.2px;
}

.rom-card__placeholder {
    width: 100%;
    height: 100%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 1.5rem;
}

/* ========== SINGLE GAME DETAIL ========== */
.game-breadcrumb {
    padding: 0 0 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.game-breadcrumb a { color: var(--text-muted); }
.game-breadcrumb a:hover { color: var(--primary); }
.game-breadcrumb .sep { margin: 0 8px; color: var(--text-light); }

/* Game Header: Cover Left + Info Right */
.game-header {
    display: flex;
    gap: 28px;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
}
.game-header__cover {
    flex-shrink: 0;
    width: 180px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #f1f5f9;
}
.game-header__cover img {
    width: 100%;
    height: auto;
    display: block;
}
.game-header__info { flex: 1; min-width: 0; }
.game-header__title {
    font-family: var(--font-head);
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 8px;
}
.format-badge {
    display: inline-block;
    background: #ede9fe;
    color: #6366f1;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
}
.game-header__rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    font-size: 0.9rem;
}
.game-header__rating .stars { color: #f59e0b; }
.game-header__rating .score { color: var(--text-muted); font-size: 0.85rem; }

.game-header__meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin-bottom: 16px;
    border-top: 1px solid var(--border);
}
.gh-meta-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px 8px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.82rem;
}
.gh-meta-item:nth-child(even) { padding-left: 12px; border-left: 1px solid var(--border-light); padding-right: 0; }
.gh-meta-label { color: var(--text-muted); }
.gh-meta-value { font-weight: 600; color: var(--text); }
.gh-meta-value a { color: var(--primary); }
.gh-meta-value a:hover { text-decoration: underline; }

.game-header__downloads {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.download-btn {
    display: inline-block;
    padding: 12px 28px;
    background: var(--accent);
    color: #fff;
    text-align: center;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}
.download-btn:hover { background: var(--accent-hover); color: #fff; }

/* Content Sections */
.game-content { max-width: 100%; }

.game-section {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.game-section__title {
    font-family: var(--font-head);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

/* Screenshots */
.screenshots-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
}
.screenshots-scroll::-webkit-scrollbar { height: 4px; }
.screenshots-scroll::-webkit-scrollbar-track { background: transparent; }
.screenshots-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.ss-thumb {
    min-width: 220px;
    height: 130px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    scroll-snap-align: start;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}
.ss-thumb:hover { border-color: var(--primary); }
.ss-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Description */
.game-description p { color: #475569; margin-bottom: 12px; line-height: 1.8; }
.game-description a { color: var(--primary); }
.game-description a:hover { text-decoration: underline; }

/* Related Games (horizontal scroll) */
.related-scroll {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 8px;
}
.related-scroll::-webkit-scrollbar { height: 4px; }
.related-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.related-item { min-width: 140px; max-width: 140px; }
.related-item a { display: block; }

.related-item__img {
    aspect-ratio: 3/4;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 8px;
    background: var(--border-light);
}
.related-item__img img { width: 100%; height: 100%; object-fit: cover; }

.related-item__title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

/* ========== ARCHIVE & SEARCH ========== */
.archive-header { margin-bottom: 24px; }
.archive-header h1 {
    font-family: var(--font-head);
    font-size: 1.5rem;
    font-weight: 800;
}
.archive-header p { color: var(--text-muted); font-size: 0.9rem; margin-top: 4px; }

.search-hero { text-align: center; margin-bottom: 30px; }
.search-hero h1 {
    font-family: var(--font-head);
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 4px;
}
.search-hero h1 span { color: var(--primary); }

/* ========== PAGINATION ========== */
.paging-nav {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 30px 0;
}
.paging-nav a, .paging-nav span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--surface);
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
}
.paging-nav a:hover { color: var(--primary); box-shadow: var(--shadow-md); }
.paging-nav .current {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}

/* ========== 404 ========== */
.page-404 { text-align: center; padding: 100px 20px; }
.page-404__code {
    font-family: var(--font-head);
    font-size: 100px;
    font-weight: 900;
    color: var(--border);
    line-height: 1;
}
.page-404 h2 { font-family: var(--font-head); font-size: 1.5rem; font-weight: 700; margin: 10px 0; }
.page-404 p { color: var(--text-muted); margin-bottom: 24px; }

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: all 0.2s ease;
}
.btn-primary:hover { background: var(--primary-hover); color: #fff; }

/* ========== PAGE CONTENT ========== */
.page-wrap {
    max-width: 800px;
    margin: 0 auto;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow);
}
.page-wrap h1 {
    font-family: var(--font-head);
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.page-wrap .entry-content h2, .page-wrap .entry-content h3 { margin: 24px 0 10px; font-family: var(--font-head); }
.page-wrap .entry-content p { margin-bottom: 14px; color: #475569; line-height: 1.8; }
.page-wrap .entry-content ul, .page-wrap .entry-content ol { margin: 0 0 14px 24px; color: #475569; }
.page-wrap .entry-content a { color: var(--primary); }
.page-wrap .entry-content a:hover { text-decoration: underline; }

/* ========== FOOTER ========== */
.main-footer {
    background: var(--dark);
    color: var(--text-light);
    padding: 32px 0 20px;
    margin-top: 40px;
}
.main-footer .container { text-align: center; }
.footer-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.footer-nav a {
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.15s ease;
}
.footer-nav a:hover { color: #fff; }
.footer-copy { font-size: 0.75rem; color: #475569; }

/* ========== LIGHTBOX ========== */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.lightbox.active { display: flex; }
.lightbox img { max-width: 90%; max-height: 90vh; border-radius: var(--radius-sm); }
.lightbox__close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox__close:hover { background: rgba(255,255,255,0.2); }

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    grid-column: 1 / -1;
}
.empty-state h3 { font-family: var(--font-head); font-weight: 700; margin-bottom: 6px; font-size: 0.95rem; }
.empty-state p { color: var(--text-muted); margin-bottom: 16px; font-size: 0.85rem; }

/* ========== ABOUT BLOCK ========== */
.about-block {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    margin-top: 8px;
    border: 1px solid var(--border);
}
.about-block h3 { font-family: var(--font-head); font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.about-block p { color: var(--text-muted); font-size: 0.85rem; line-height: 1.7; }

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .rom-grid { grid-template-columns: repeat(4, 1fr); }
    .game-header { gap: 20px; }
    .game-header__cover { width: 150px; }
}

@media (max-width: 768px) {
    .rom-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
    .main-nav { display: none; }
    .main-nav.open {
        display: flex; flex-direction: column;
        position: absolute; top: 64px; left: 0; right: 0;
        background: var(--dark); border-top: 1px solid rgba(255,255,255,0.05);
        padding: 12px; z-index: 100;
    }
    .mobile-btn { display: block; }
    .search-box { display: none; }
    .game-header { flex-direction: column; align-items: center; text-align: center; }
    .game-header__cover { width: 160px; }
    .game-header__meta { grid-template-columns: 1fr; }
    .gh-meta-item:nth-child(even) { padding-left: 0; border-left: none; padding-right: 0; }
    .game-header__downloads { justify-content: center; }
    .main-header .container { gap: 1rem; }
}

@media (max-width: 480px) {
    .rom-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .page-wrap { padding: 24px 16px; }
    .meta-card { padding: 16px; }
}

/* ========== COMMENTS ========== */
.game-comments .comments-area { margin-top: 0; }
.game-comments .comments-area h3 {
    font-family: var(--font-head);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text);
}

.game-comments .comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.game-comments .comment-list .comment {
    padding: 16px;
    margin-bottom: 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}
.game-comments .comment-author {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.game-comments .comment-author img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--primary);
}
.game-comments .author-name {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text);
}
.game-comments .comment-date {
    display: block;
    font-size: 0.72rem;
    color: var(--text-light);
}
.game-comments .comment-content {
    font-size: 0.88rem;
    line-height: 1.6;
    color: #475569;
    padding-left: 46px;
}
.game-comments .comment-content p { margin: 0 0 6px; }
.game-comments .reply a {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
}
.game-comments .reply a:hover { text-decoration: underline; }
.game-comments .children {
    list-style: none;
    padding-left: 24px;
    margin-top: 0;
    border-left: 2px solid var(--primary);
}

/* Comment Form */
.game-comments .comment-form {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.game-comments .comment-form label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.game-comments .comment-form input[type="text"],
.game-comments .comment-form input[type="email"],
.game-comments .comment-form input[type="url"],
.game-comments .comment-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.88rem;
    background: var(--bg);
    color: var(--text);
    transition: border-color 0.2s;
    margin-bottom: 12px;
}
.game-comments .comment-form input:focus,
.game-comments .comment-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.game-comments .comment-form textarea { min-height: 100px; resize: vertical; }
.game-comments .comment-form .comment-notes { display: none; }
.game-comments .comment-form .form-submit {
    margin-top: 4px;
}
.game-comments .comment-form .submit,
.game-comments .comment-form .btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background 0.2s;
    font-family: var(--font-body);
}
.game-comments .comment-form .submit:hover { background: var(--primary-hover); }
.game-comments .comment-respond .comment-reply-title {
    font-family: var(--font-head);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 12px;
}
.game-comments .comment-navigation {
    display: flex;
    justify-content: space-between;
    margin: 16px 0;
    font-size: 0.85rem;
}
.game-comments .comment-navigation a { color: var(--primary); font-weight: 600; }

/* ========== DOWNLOAD PAGE ========== */
.download-page {
    display: flex;
    justify-content: center;
    padding: 60px 20px;
}
.download-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 40px;
    text-align: center;
    max-width: 420px;
    width: 100%;
}
.download-card__thumb {
    width: 80px;
    height: auto;
    border-radius: var(--radius-sm);
    margin: 0 auto 16px;
}
.download-card__title {
    font-family: var(--font-head);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.download-card__info {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 28px;
}
.download-card__timer {
    margin-bottom: 24px;
}
.timer-circle {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 12px;
}
.timer-circle svg { display: block; }
.timer-circle span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    font-family: var(--font-head);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}
.download-card__timer p {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.download-btn--big {
    font-size: 1rem;
    padding: 16px 32px;
    display: inline-block;
}
.download-card__ready { margin-bottom: 20px; }
.download-card__back {
    font-size: 0.82rem;
    color: var(--text-muted);
    display: inline-block;
    margin-top: 12px;
}
.download-card__back:hover { color: var(--primary); }

/* Admin Bar Fix */
.admin-bar .main-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .main-header { top: 46px; } }
