/* ==========================================================================
   TTPGame Web Launcher - Core Design System & Styling
   Theme: Modern Cyber Gaming (Dark Mode, Glassmorphism, Neon Accents)
   ========================================================================== */

:root {
  --bg-dark: #090d16;
  --bg-card: rgba(22, 30, 49, 0.85);
  --bg-card-hover: rgba(30, 42, 69, 0.95);
  --bg-sidebar: #0e1424;
  --bg-header: rgba(14, 20, 36, 0.9);
  
  --primary-gold: #f59e0b;
  --primary-gold-glow: rgba(245, 158, 11, 0.4);
  --cyan-neon: #06b6d4;
  --cyan-glow: rgba(6, 182, 212, 0.4);
  --emerald-online: #10b981;
  --rose-maint: #f43f5e;
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-active: rgba(245, 158, 11, 0.6);
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  
  --shadow-glow: 0 0 20px rgba(6, 182, 212, 0.25);
  --shadow-gold: 0 0 20px rgba(245, 158, 11, 0.3);
  --font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-gold);
}

/* App Container Layout */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  background: radial-gradient(circle at 80% 20%, #151d33 0%, #090d16 80%);
}

/* Sidebar Navigation */
.app-sidebar {
  width: 90px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
  z-index: 20;
}

.brand-logo {
  width: 52px;
  height: 52px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #10b981, #06b6d4);
  border-radius: var(--radius-md);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
  color: #fff;
  font-weight: 900;
  font-size: 22px;
  cursor: pointer;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  padding: 0 12px;
  overflow-y: auto;
}

.sidebar-item {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.sidebar-item img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
}

.sidebar-item .item-title {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60px;
}

.sidebar-item:hover, .sidebar-item.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--primary-gold);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px var(--primary-gold-glow);
}

.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 24px;
  background: var(--primary-gold);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 8px var(--primary-gold);
}

/* Main Area */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Top Header Bar */
.app-header {
  height: 64px;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-glass);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 10;
}

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

.header-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, #fff, var(--primary-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 11px;
  color: var(--emerald-online);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald-online);
  box-shadow: 0 0 8px var(--emerald-online);
}

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

.search-box {
  position: relative;
}

.search-box input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  padding: 8px 16px 8px 36px;
  border-radius: var(--radius-full);
  color: #fff;
  font-size: 12px;
  width: 200px;
  transition: all 0.3s ease;
}

.search-box input:focus {
  outline: none;
  border-color: var(--cyan-neon);
  box-shadow: 0 0 10px var(--cyan-glow);
  width: 240px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
}

.btn-header {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-header:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Scrollable Content View */
.content-wrapper {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

/* Hero Section / Banner */
.hero-banner {
  position: relative;
  width: 100%;
  height: 240px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid var(--border-glass);
}

.banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.65;
  transition: transform 0.5s ease;
}

.hero-banner:hover .banner-img {
  transform: scale(1.03);
}

.banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(9, 13, 22, 0.95) 0%, rgba(9, 13, 22, 0.2) 60%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px 32px;
}

.banner-tag {
  align-self: flex-start;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  background: var(--primary-gold);
  color: #000;
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.banner-title {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.banner-desc {
  color: var(--text-muted);
  font-size: 13px;
  max-width: 600px;
  margin-bottom: 16px;
}

.btn-play-hero {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(90deg, #f59e0b, #d97706);
  color: #000;
  font-weight: 800;
  font-size: 14px;
  padding: 10px 28px;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  box-shadow: 0 0 20px var(--primary-gold-glow);
  transition: all 0.3s ease;
}

.btn-play-hero:hover {
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.6);
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

/* Grid Sections */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 16px;
  background: var(--cyan-neon);
  border-radius: 2px;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

/* Game Card */
.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  position: relative;
}

.game-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary-gold);
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 0 0 15px var(--primary-gold-glow);
}

.game-thumb-wrapper {
  position: relative;
  width: 100%;
  height: 120px;
  overflow: hidden;
  background: #111827;
}

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

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

.game-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.9);
  color: #fff;
}

.game-badge.maintenance {
  background: rgba(244, 63, 94, 0.9);
}

.game-info {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.game-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.game-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-launch-card {
  margin-top: auto;
  width: 100%;
  padding: 8px 0;
  border-radius: var(--radius-sm);
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: var(--cyan-neon);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.game-card:hover .btn-launch-card {
  background: var(--primary-gold);
  border-color: var(--primary-gold);
  color: #000;
  box-shadow: 0 0 10px var(--primary-gold-glow);
}

/* Two Column Layout for News & Servers */
.two-col-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
}

/* News List */
.news-box {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 20px;
}

.news-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 10px;
}

.news-tab {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.news-tab.active, .news-tab:hover {
  color: var(--primary-gold);
  background: rgba(245, 158, 11, 0.1);
}

.news-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: all 0.2s;
}

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

.news-item:hover {
  transform: translateX(4px);
}

.news-item-title {
  font-size: 13px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.news-tag-hot {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  background: #ef4444;
  color: #fff;
  font-weight: 700;
}

.news-date {
  font-size: 11px;
  color: var(--text-dim);
}

/* Server Selector Sidebar Widget */
.server-widget {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 20px;
}

.server-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.server-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.server-row:hover, .server-row.selected {
  border-color: var(--cyan-neon);
  background: rgba(6, 182, 212, 0.1);
}

.server-name {
  font-weight: 600;
  font-size: 13px;
  color: #fff;
}

.server-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--emerald-online);
}

/* Modal Styling */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #111827;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8), 0 0 30px var(--cyan-glow);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.modal-backdrop.show .modal-card {
  transform: scale(1);
}

.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  color: var(--text-main);
  font-size: 13px;
  line-height: 1.6;
}
