/*
Theme Name: SwitchROM
Theme URI: https://switchrom.org
Author: SwitchROM Team
Author URI: https://switchrom.org
Description: High performance, ultra-responsive Nintendo Switch ROM portal theme with 3 Screenshots Lightbox, Custom Files / 60 FPS Patches, 2-Step PPI protection, game specs table, install guides, and SEO optimization.
Version: 2.3.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: switchrom
*/

:root {
  --primary-red: #e60012;
  --joycon-blue: #0ea5e9;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --bg-page: #f8fafc;
  --card-bg: #ffffff;
  --border-color: #e2e8f0;
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-dark);
  margin: 0;
  padding: 0;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Top Utility Bar */
.switchrom-topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 8px 16px;
  font-size: 11px;
  color: var(--text-muted);
}

.switchrom-topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pulse-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: #10b981;
  border-radius: 50%;
  margin-right: 6px;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

/* Header & Brand */
.switchrom-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 24px 20px 16px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
}

.switchrom-logo-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.switchrom-logo-link:hover {
  transform: scale(1.02);
}

/* Joycon Icon */
.joycon-badge {
  display: flex;
  background: #000000;
  padding: 4px 5px;
  border-radius: 6px;
}

.joycon-left {
  width: 10px;
  height: 20px;
  background: var(--primary-red);
  border-radius: 4px 0 0 4px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 2px 0;
}

.joycon-gap {
  width: 2px;
  height: 20px;
  background: #000000;
}

.joycon-right {
  width: 10px;
  height: 20px;
  background: var(--joycon-blue);
  border-radius: 0 4px 4px 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 2px 0;
}

.joycon-dot-white {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ffffff;
}

.joycon-dot-dim {
  width: 4px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.6);
}

.switchrom-brand-title {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  color: #000000;
  text-transform: uppercase;
  margin: 0;
  line-height: 1;
}

.switchrom-brand-title span {
  color: var(--primary-red);
}

.switchrom-brand-sub {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: #94a3b8;
  text-transform: uppercase;
  margin: 4px 0 0;
}

/* Search Bar */
.switchrom-search-wrap {
  max-width: 580px;
  margin: 16px auto 10px;
}

.switchrom-search-input {
  width: 100%;
  padding: 10px 18px;
  border-radius: 9999px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  font-size: 0.875rem;
  outline: none;
  transition: all 0.2s ease;
}

.switchrom-search-input:focus {
  border-color: #000000;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

/* Category Filter Chips */
.switchrom-categories-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  max-width: 900px;
  margin: 14px auto 0;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f1f5f9;
  color: #334155;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.cat-pill:hover {
  background: #000000;
  color: #ffffff;
}

.cat-pill:hover .cat-count {
  background: var(--primary-red);
  color: #ffffff;
}

.cat-count {
  background: #cbd5e1;
  color: #0f172a;
  border-radius: 9999px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
}

/* Game Grid with Black Outline on Hover */
.switchrom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 16px;
}

.switchrom-card {
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  transition: all 0.18s ease;
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.switchrom-card:hover {
  border-color: #000000; /* Black line border on hover requested by user */
  transform: translateY(-2px);
  box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.12);
}

.switchrom-cover-wrap {
  position: relative;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: #0f172a;
}

.switchrom-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.switchrom-card:hover .switchrom-cover-img {
  transform: scale(1.04);
}

.switchrom-badge-format {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--primary-red);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.switchrom-badge-size {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.switchrom-card-body {
  padding: 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.switchrom-card-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 6px;
  color: #0f172a;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.switchrom-card-sub {
  font-size: 11px;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ====================================================
   SINGLE POST LAYOUT (GameDetail)
   ==================================================== */
.switchrom-single-layout {
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
}

@media (max-width: 900px) {
  .switchrom-single-layout {
    grid-template-columns: 1fr;
  }
}

/* Main Info Card */
.switchrom-info-box {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.switchrom-specs-layout {
  display: flex;
  gap: 20px;
}

@media (max-width: 640px) {
  .switchrom-specs-layout {
    flex-direction: column;
    align-items: center;
  }
}

.switchrom-specs-cover {
  width: 180px;
  flex-shrink: 0;
  position: relative;
}

.switchrom-specs-cover img {
  width: 100%;
  border-radius: 6px;
  display: block;
}

.switchrom-specs-content {
  flex: 1;
  min-width: 0;
}

.switchrom-post-title {
  font-size: 1.4rem;
  font-weight: 900;
  color: #000000;
  margin: 0 0 14px;
  line-height: 1.25;
}

/* Specs Table Matching Reference */
.switchrom-specs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.switchrom-specs-table tr {
  border-bottom: 1px solid #f1f5f9;
}

.switchrom-specs-table td {
  padding: 7px 8px;
}

.specs-label {
  color: #64748b;
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  width: 25%;
}

.specs-value-red {
  color: var(--primary-red);
  font-weight: 700;
  width: 25%;
}

.specs-value-bold {
  color: #0f172a;
  font-weight: 700;
  width: 25%;
}

/* ====================================================
   3 SCREENSHOTS GALLERY & LIGHTBOX VIEWER
   ==================================================== */
.switchrom-screenshots-box {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.switchrom-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}

.switchrom-section-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.switchrom-screenshots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 640px) {
  .switchrom-screenshots-grid {
    grid-template-columns: 1fr;
  }
}

.screenshot-thumb-item {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: 6px;
  overflow: hidden;
  background: #0f172a;
  cursor: pointer;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.screenshot-thumb-item:hover {
  border-color: #000000;
  transform: scale(1.02);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.screenshot-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.screenshot-tag {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
}

/* Fullscreen Lightbox Modal */
.switchrom-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 10000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(4px);
}

.switchrom-lightbox.active {
  display: flex;
}

.lightbox-main-img {
  max-width: 90vw;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.lightbox-controls {
  position: absolute;
  top: 16px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.lightbox-close-btn {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border: none;
  font-size: 20px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.lightbox-close-btn:hover {
  background: var(--primary-red);
}

.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border: none;
  font-size: 24px;
  font-weight: 900;
  padding: 14px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lightbox-nav-btn:hover {
  background: rgba(255, 255, 255, 0.4);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-strip {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.lightbox-strip-item {
  width: 70px;
  height: 40px;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.6;
  transition: all 0.2s ease;
}

.lightbox-strip-item.active {
  border-color: var(--primary-red);
  opacity: 1;
  transform: scale(1.05);
}

.lightbox-strip-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ====================================================
   CUSTOM FILES & 60 FPS PATCHES SECTION
   ==================================================== */
.switchrom-custom-files-box {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.cf-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid #f1f5f9;
  background: #f8fafc;
  margin-bottom: 8px;
  gap: 12px;
  transition: all 0.15s ease;
}

.cf-item:hover {
  background: #ffffff;
  border-color: #cbd5e1;
}

.cf-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

/* Color Badges for Formats */
.cf-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.cf-badge-patch { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.cf-badge-cheat { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.cf-badge-sav   { background: #e0e7ff; color: #4338ca; border: 1px solid #c7d2fe; }
.cf-badge-mod   { background: #f3e8ff; color: #7e22ce; border: 1px solid #e9d5ff; }
.cf-badge-zip   { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }

.cf-name {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cf-desc {
  font-size: 10px;
  color: #64748b;
  margin-top: 1px;
}

.cf-btn-dl {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #0f172a;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.15s ease;
  flex-shrink: 0;
}

.cf-btn-dl:hover {
  background: var(--primary-red);
}

/* ====================================================
   MAIN DOWNLOAD BUTTONS & 2-STEP PPI
   ==================================================== */
.switchrom-dl-box {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  text-align: center;
}

.switchrom-dl-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 14px;
}

.switchrom-btn-dl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  color: #ffffff;
  background: #0f172a;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.switchrom-btn-dl:hover {
  background: var(--primary-red);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(230, 0, 18, 0.3);
}

.switchrom-btn-dl.dl-update {
  background: #1e293b;
}

.switchrom-btn-dl.dl-update:hover {
  background: #2563eb;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.3);
}

.switchrom-btn-dl.dl-dlc {
  background: #334155;
}

.switchrom-btn-dl.dl-dlc:hover {
  background: #059669;
  box-shadow: 0 6px 14px rgba(5, 150, 105, 0.3);
}

.switchrom-btn-dl.dl-mirror {
  background: #475569;
}

.switchrom-btn-dl.dl-mirror:hover {
  background: #7c3aed;
  box-shadow: 0 6px 14px rgba(124, 58, 237, 0.3);
}

/* PPI Modal Popup */
.switchrom-ppi-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.switchrom-ppi-modal.active {
  display: flex;
}

.switchrom-ppi-box {
  background: #ffffff;
  border-radius: 12px;
  padding: 24px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

.ppi-countdown {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--primary-red);
  margin: 12px 0;
}

/* ====================================================
   REACTIONS BAR
   ==================================================== */
.switchrom-reactions-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px 20px;
  margin-bottom: 20px;
}

.reaction-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.reaction-btn:hover {
  background: #000000;
  color: #ffffff;
  border-color: #000000;
}

/* ====================================================
   FAQ ACCORDION
   ==================================================== */
.switchrom-faq-box {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.faq-item {
  border-bottom: 1px solid #f1f5f9;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-q {
  padding: 12px 0;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-a {
  display: none;
  padding: 0 0 12px;
  font-size: 12px;
  color: #475569;
  line-height: 1.6;
}

.faq-item.open .faq-a {
  display: block;
}

.faq-item.open .faq-icon {
  transform: rotate(180deg);
}

/* Installation Guide Callout */
.install-guide-box {
  background: #f8fafc;
  border-left: 4px solid var(--primary-red);
  padding: 16px 20px;
  border-radius: 0 8px 8px 0;
  margin: 20px 0;
  font-size: 12px;
}

.install-guide-box ol {
  padding-left: 18px;
  margin: 8px 0 0;
  color: #334155;
  line-height: 1.6;
}

/* Sidebar */
.switchrom-sidebar-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}

.sidebar-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #0f172a;
  margin: 0 0 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid #000000;
}

/* Footer */
.switchrom-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 40px 20px 24px;
  margin-top: 40px;
  font-size: 12px;
}

.switchrom-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}
