/*
Theme Name: SwitchVault Premium
Author: Admin
Version: 2.5
Description: Complete functional premium NSVault clone theme for Nintendo Switch ROM downloading.
*/

/* ==========================================================================
   GLOBAL RESET & CSS VARIABLES
   ========================================================================== */
:root {
  --bg-main: #0d0d0d;
  --bg-card: #161616;
  --bg-card-hover: #1f1f1f;
  --accent-red: #e60012;
  --accent-red-hover: #ff1a2b;
  --accent-green: #00ff66;
  --text-white: #ffffff;
  --text-muted: #8a8a8a;
  --border-color: #262626;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  --shadow-red: 0 4px 20px rgba(230, 0, 18, 0.35);
  --border-radius: 8px;
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-white);
  font-family: var(--font-family);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  transition: all 0.2s ease-in-out;
}

a:hover {
  color: var(--accent-red);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ==========================================================================
   HEADER & NAVIGATION BAR
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: rgba(13, 13, 13, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 0;
}

.header-container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.5px;
  text-transform: uppercase;
}

.site-logo .logo-ns {
  color: var(--accent-red);
}

.site-logo .logo-vault {
  color: var(--text-white);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.header-nav a {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-white);
  padding: 6px 12px;
  border-radius: 6px;
}

.header-nav a:hover,
.header-nav a.active {
  color: var(--accent-red);
  background-color: rgba(230, 0, 18, 0.1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-toggle-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-white);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.search-toggle-btn:hover {
  background-color: var(--accent-red);
  border-color: var(--accent-red);
  transform: scale(1.05);
}

/* Search Modal / Bar Toggle */
.header-search-bar {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: #111111;
  border-bottom: 1px solid var(--accent-red);
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}

.header-search-bar.active {
  display: block;
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.search-form-inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
}

.search-input {
  flex: 1;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  color: var(--text-white);
  padding: 12px 18px;
  border-radius: 6px;
  font-size: 16px;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-red);
}

.search-submit-btn {
  background: var(--accent-red);
  color: var(--text-white);
  border: none;
  padding: 0 24px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
}

/* ==========================================================================
   CONTAINER & LAYOUT GRID SYSTEM
   ========================================================================== */
.site-main {
  max-width: 1380px;
  margin: 30px auto;
  padding: 0 20px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 10px;
}

.section-title {
  font-size: 20px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 20px;
  background-color: var(--accent-red);
  border-radius: 2px;
}

.slider-controls {
  display: flex;
  gap: 8px;
}

.slider-arrow {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-white);
  width: 34px;
  height: 34px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.slider-arrow:hover {
  background: var(--accent-red);
  border-color: var(--accent-red);
}

/* ==========================================================================
   VERTICAL SWITCH BOX-ART CARD (2:3 RATIO) & 6-COLUMN GRID
   ========================================================================== */
.grid-6-col {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
  margin-bottom: 40px;
}

.game-card {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.25s ease-in-out;
  display: flex;
  flex-direction: column;
  position: relative;
}

.game-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: rgba(230, 0, 18, 0.6);
  box-shadow: var(--shadow-red);
}

.card-thumb-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background-color: #000;
}

.card-thumb-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.game-card:hover .card-thumb-wrapper img {
  transform: scale(1.08);
}

/* Badges */
.badge-switch {
  position: absolute;
  top: 8px;
  left: 8px;
  background-color: var(--accent-red);
  color: var(--text-white);
  font-size: 11px;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  z-index: 2;
}

.badge-format {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.85);
  color: var(--text-white);
  border: 1px solid var(--border-color);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  z-index: 2;
}

.badge-update {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--accent-red);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 4px;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

.card-info {
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-white);
  line-height: 1.3;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 36px;
}

.card-title a:hover {
  color: var(--accent-red);
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 8px;
}

.card-size {
  color: var(--accent-red);
  font-weight: 700;
}

/* ==========================================================================
   SECTION 2: NEW ROMS ADDED (ROWS LAYOUT)
   ========================================================================== */
.roms-rows-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 30px;
}

.rom-row-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s;
}

.rom-row-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-red);
  transform: translateX(4px);
}

.rom-row-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.rom-row-thumb {
  width: 42px;
  aspect-ratio: 2 / 3;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}

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

.rom-row-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rom-row-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-white);
}

.rom-row-title a:hover {
  color: var(--accent-red);
}

.rom-row-tags {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.tag-base {
  color: var(--accent-green);
  font-weight: 700;
  background: rgba(0, 255, 102, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
}

.tag-update {
  color: var(--accent-red);
  font-weight: 700;
  background: rgba(230, 0, 18, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
}

.rom-row-date {
  color: var(--text-muted);
}

.rom-row-center-right {
  margin: 0 20px;
}

.format-box {
  background: #0d0d0d;
  border: 1px solid var(--border-color);
  color: var(--text-white);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}

.rom-row-right {
  text-align: right;
  min-width: 90px;
}

.file-size-bold {
  color: var(--accent-red);
  font-weight: 900;
  font-size: 15px;
}

/* AJAX Load More Button */
.load-more-container {
  text-align: center;
  margin: 30px 0 50px 0;
}

.btn-load-more {
  background: var(--bg-card);
  color: var(--text-white);
  border: 1px solid var(--accent-red);
  padding: 14px 36px;
  font-size: 15px;
  font-weight: 800;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.25s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.btn-load-more:hover {
  background: var(--accent-red);
  box-shadow: var(--shadow-red);
  transform: translateY(-2px);
}

/* ==========================================================================
   SINGLE.PHP GAME DOWNLOAD PAGE ARCHITECTURE
   ========================================================================== */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
  background: var(--bg-card);
  padding: 10px 18px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.breadcrumbs a {
  color: var(--text-muted);
}

.breadcrumbs a:hover {
  color: var(--accent-red);
}

.breadcrumbs .separator {
  color: var(--border-color);
}

.breadcrumbs .current {
  color: var(--text-white);
  font-weight: 600;
}

.game-single-wrapper {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 30px;
}

.single-main-content {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* Top 2-Column Split: 1/3 Box Art Cover + 3 Buttons, 2/3 Meta Table */
.single-game-hero {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 28px;
  background: var(--bg-card);
  padding: 24px;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
}

.game-cover-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero-boxart {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: var(--border-radius);
  object-fit: cover;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.download-buttons-group {
  display: flex;
  gap: 8px;
}

.btn-dl {
  flex: 1;
  padding: 10px 4px;
  font-size: 12px;
  font-weight: 800;
  border-radius: 6px;
  text-align: center;
  text-transform: uppercase;
  transition: all 0.2s;
  cursor: pointer;
}

.btn-dl-red {
  background: var(--accent-red);
  color: var(--text-white);
  border: 1px solid var(--accent-red);
}

.btn-dl-red:hover {
  background: var(--accent-red-hover);
  box-shadow: var(--shadow-red);
}

.btn-dl-outline {
  background: transparent;
  color: var(--text-white);
  border: 1px solid var(--accent-red);
}

.btn-dl-outline:hover {
  background: var(--accent-red);
  color: var(--text-white);
}

.game-info-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.game-hero-title {
  font-size: 28px;
  font-weight: 900;
  line-height: 1.2;
}

/* 5-Star Rating Breakdown Module */
.rating-module {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #0f0f0f;
  padding: 10px 16px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  width: fit-content;
}

.stars-row {
  color: #ffb400;
  font-size: 16px;
}

.rating-score {
  font-weight: 800;
  font-size: 16px;
  color: var(--text-white);
}

.rating-count {
  font-size: 12px;
  color: var(--text-muted);
}

/* Stylized Information Table */
.info-meta-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.info-meta-table tr {
  border-bottom: 1px solid var(--border-color);
}

.info-meta-table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.info-meta-table td {
  padding: 10px 14px;
  font-size: 14px;
}

.info-meta-table td.key-label {
  color: var(--text-muted);
  font-weight: 600;
  width: 160px;
  background: rgba(0, 0, 0, 0.2);
}

.info-meta-table td.val-data {
  color: var(--text-white);
  font-weight: 700;
}

/* Section B: Dynamic Description Block */
.section-block {
  background: var(--bg-card);
  padding: 24px;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
}

.block-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--accent-red);
  display: inline-block;
  padding-bottom: 4px;
}

.game-description-body {
  color: #cccccc;
  line-height: 1.8;
  font-size: 15px;
}

/* Section C: Game Screenshots Grid */
.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.screenshot-item {
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  cursor: pointer;
}

.screenshot-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease, filter 0.3s ease;
  filter: brightness(0.9);
}

.screenshot-item:hover img {
  transform: scale(1.05);
  filter: brightness(1.1);
}

/* Section D: Accordion Toggles (FAQ) */
.accordion-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.accordion-item {
  background: #111111;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
}

.accordion-header {
  padding: 16px 20px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  user-select: none;
  transition: background 0.2s;
}

.accordion-header:hover {
  background: var(--bg-card-hover);
  color: var(--accent-red);
}

.accordion-content {
  padding: 0 20px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0, 1, 0, 1), padding 0.3s;
  color: #bbbbbb;
  font-size: 14px;
  line-height: 1.7;
}

.accordion-item.open .accordion-content {
  padding: 16px 20px;
  max-height: 500px;
  border-top: 1px solid var(--border-color);
}

/* Section E: Native Comments Form */
.comments-container {
  margin-top: 10px;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

.comment-input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.comment-field {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  color: var(--text-white);
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
}

.comment-field:focus {
  outline: none;
  border-color: var(--accent-red);
}

textarea.comment-field {
  min-height: 110px;
  resize: vertical;
}

.btn-submit-comment {
  background: var(--accent-red);
  color: var(--text-white);
  border: none;
  padding: 12px 28px;
  font-weight: 800;
  border-radius: 6px;
  cursor: pointer;
  width: fit-content;
  transition: all 0.2s;
}

.btn-submit-comment:hover {
  background: var(--accent-red-hover);
  box-shadow: var(--shadow-red);
}

/* Section F: Related Items Grid */
.related-items-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}

/* ==========================================================================
   SIDEBAR.PHP WIDGET (MOST POPULAR IN ACTION)
   ========================================================================== */
.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 20px;
}

.widget-title {
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--accent-red);
  padding-bottom: 8px;
  letter-spacing: 0.5px;
}

.popular-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.popular-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.popular-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.popular-thumb {
  width: 50px;
  aspect-ratio: 2 / 3;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
}

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

.popular-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.popular-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-white);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.popular-title a:hover {
  color: var(--accent-red);
}

.popular-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.popular-size {
  color: var(--accent-red);
  font-weight: 700;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  background: #080808;
  border-top: 1px solid var(--border-color);
  padding: 30px 0;
  margin-top: 60px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.footer-container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 12px;
}

.footer-links a:hover {
  color: var(--accent-red);
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES
   ========================================================================== */
@media (max-width: 1200px) {
  .grid-6-col, .related-items-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 992px) {
  .game-single-wrapper {
    grid-template-columns: 1fr;
  }
  .single-game-hero {
    grid-template-columns: 1fr;
  }
  .hero-boxart {
    max-width: 260px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .grid-6-col, .related-items-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .screenshots-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .header-nav {
    display: none;
  }
  .rom-row-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .rom-row-center-right, .rom-row-right {
    margin: 0;
    text-align: left;
  }
}
