/* Main Stylesheet for Tournament Application */

/* ============================================
   THEME COLOR VARIABLES
   ============================================ */
:root {
  --dark-bg: #0a0e27;
  --container-bg: #0f1429;
  --card-bg: #1a1f3a;
  --input-bg: #1e2442;
  --primary-purple: #a855f7;
  --primary-cyan: #06b6d4;
  --text-light: #f1f5f9;
  --text-medium: #94a3b8;
  --text-dark: #0f172a;
  --success-color: #10b981;
  --warning-color: #fbbf24;
  --danger-color: #ef4444;
  --gold: #fbbf24;
  --silver: #c0c0c0; /* Kept from original, not in update but specific */
  --bronze: #cd7f32; /* Kept from original, not in update but specific */
}

/* ============================================
   GLOBAL RESET & BASE STYLES
   ============================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Poppins", sans-serif;
  background-color: var(--dark-bg);
  color: var(--text-light);
  background-image: linear-gradient(rgba(13, 13, 26, 0.98), rgba(13, 13, 26, 0.98)),
    url("https://www.transparenttextures.com/patterns/carbon-fibre.png");
  overflow-x: hidden;
  -webkit-user-select: none;
  user-select: none;
  margin: 0;
  padding: 0;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-purple);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-cyan);
}

/* Fixed page-content to eliminate blank space */
.page-content {
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  padding-bottom: 80px;
  margin: 0;
}

.page-content::-webkit-scrollbar {
  width: 6px;
}

.page-content::-webkit-scrollbar-track {
  background: transparent;
}

.page-content::-webkit-scrollbar-thumb {
  background: rgba(168, 85, 247, 0.5);
  border-radius: 10px;
}

.page-content::-webkit-scrollbar-thumb:hover {
  background: rgba(168, 85, 247, 0.8);
}

/* ============================================
   CONTAINER & LAYOUT
   ============================================ */
/* Removed padding-bottom and extra spacing from main-container */
.main-container {
  max-width: 500px;
  margin: 0 auto;
  padding: 0;
  min-height: 100vh;
}

.admin-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  padding-bottom: 40px;
}

.section {
  padding: 0 15px 15px 15px;
  animation: fadeInUp 0.6s ease;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--text-light);
}

.section-subtitle {
  font-size: 12px;
  color: var(--text-medium);
  margin-bottom: 15px;
}

/* ============================================
   TOP HEADER (USER PANEL)
   ============================================ */
/* Removed extra padding and margin from top-header */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background-color: var(--container-bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 999;
  backdrop-filter: blur(10px);
  margin: 0;
}

.user-info {
  display: flex;
  align-items: center;
  animation: slideInLeft 0.5s ease;
}

.user-info .avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: 2px solid var(--primary-cyan);
  margin-right: 10px;
  transition: transform 0.3s ease;
}

.user-info .avatar:hover {
  transform: scale(1.1) rotate(5deg);
}

.user-info .details h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.user-info .details p {
  margin: 0;
  font-size: 12px;
  color: var(--text-medium);
}

.wallet-info {
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--danger-color), #ff6b6b);
  padding: 8px 12px;
  border-radius: 25px;
  color: #fff;
  font-weight: 600;
  animation: slideInRight 0.5s ease;
  transition: all 0.3s ease;
}

.wallet-info:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(220, 53, 69, 0.4);
}

.wallet-info .icon {
  margin-right: 8px;
  font-size: 18px;
}

.wallet-info .add-money {
  margin-left: 10px;
  background-color: #fff;
  color: var(--danger-color);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.wallet-info .add-money:hover {
  transform: rotate(90deg) scale(1.2);
}

/* ============================================
   SLIDER SECTION
   ============================================ */
/* Removed all top padding and margin from slider */
.slider-container {
  padding: 0 15px 15px 15px;
  margin: 0;
  animation: fadeIn 0.8s ease;
}

.slider {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 8;
  overflow: hidden;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.slide {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.slide.active {
  opacity: 1;
}

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

.slider-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.slider-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #bbb;
  transition: all 0.3s ease;
  cursor: pointer;
}

.slider-dots .dot.active {
  background: var(--primary-cyan);
  transform: scale(1.3);
  box-shadow: 0 0 10px var(--primary-cyan);
}

/* ============================================
   CONTEST CARDS
   ============================================ */
.contest-cards {
  display: flex;
  gap: 10px;
}

.contest-card {
  flex: 1;
  min-width: 0;
  padding: 20px 10px;
  text-align: center;
  border-radius: 10px;
  transition: all 0.3s ease;
  background: var(--card-bg);
  border: 1px solid #2a2a4a;
  text-decoration: none;
  cursor: pointer;
}

.contest-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary-cyan);
  box-shadow: 0 5px 20px rgba(0, 245, 255, 0.3);
}

.contest-card .icon {
  font-size: 28px;
  margin-bottom: 5px;
  color: var(--warning-color);
  transition: all 0.3s ease;
}

.contest-card:hover .icon {
  transform: scale(1.2) rotate(10deg);
}

.contest-card p {
  margin-top: 10px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-light);
}

.contest-card:hover p {
  color: #fff;
}

/* ============================================
   GAME GRID (TOURNAMENT CARDS)
   ============================================ */
.game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.game-card {
  background-color: var(--card-bg);
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.game-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 5px 20px rgba(0, 245, 255, 0.3);
  border-color: var(--primary-cyan);
}

.game-card img {
  width: 100%;
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.game-card:hover img {
  transform: scale(1.1);
}

.game-card p {
  font-family: "Orbitron", sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-light);
  text-transform: uppercase;
  text-align: center;
  padding: 12px 5px;
  margin: 0;
}

.game-card:hover p {
  color: var(--primary-cyan);
}

/* ============================================
   BOTTOM NAVIGATION
   ============================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 500px;
  margin: 0 auto;
  height: 65px;
  background-color: var(--container-bg);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  justify-content: space-around;
  align-items: center;
  backdrop-filter: blur(10px);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-medium);
  text-decoration: none;
  transition: all 0.3s ease;
  padding: 5px 10px;
}

.nav-item .icon,
.nav-item i {
  font-size: 24px;
  transition: all 0.3s ease;
}

.nav-item p {
  font-size: 12px;
  margin-top: 2px;
}

.nav-item.active,
.nav-item:hover {
  color: var(--primary-cyan);
  transform: translateY(-3px);
}

.nav-item.active .icon,
.nav-item:hover .icon,
.nav-item.active i,
.nav-item:hover i {
  text-shadow: 0 0 10px var(--primary-cyan);
}

/* ============================================
   BUTTONS & FORMS
   ============================================ */
.btn {
  padding: 12px 24px;
  border-radius: 25px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-purple), var(--primary-cyan));
  color: #fff;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(138, 43, 226, 0.4);
}

.btn-success {
  background: linear-gradient(135deg, var(--success-color), #34ce57);
  color: #fff;
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger-color), #ff6b6b);
  color: #fff;
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning-color), #ffdb4d);
  color: var(--text-dark);
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-light);
}

.form-control {
  width: 100%;
  padding: 12px 15px;
  background-color: var(--input-bg);
  border: 1px solid #2a2a4a;
  border-radius: 10px;
  color: var(--text-light);
  font-size: 14px;
  transition: all 0.3s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-cyan);
  box-shadow: 0 0 10px rgba(0, 245, 255, 0.2);
}

/* ============================================
   CARDS & PANELS
   ============================================ */
.card {
  background: var(--card-bg);
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  animation: fadeInUp 0.6s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.card-header {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--primary-cyan);
  border-bottom: 2px solid var(--primary-purple);
  padding-bottom: 10px;
}

.card-body {
  color: var(--text-light);
}

/* ============================================
   TABS
   ============================================ */
.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.tab {
  padding: 12px 20px;
  background: transparent;
  border: none;
  color: var(--text-medium);
  cursor: pointer;
  transition: all 0.3s ease;
  border-bottom: 2px solid transparent;
  font-weight: 500;
}

.tab.active {
  color: var(--primary-cyan);
  border-bottom-color: var(--primary-cyan);
}

.tab:hover {
  color: var(--text-light);
}

.tab-content {
  display: none;
  animation: fadeIn 0.5s ease;
}

.tab-content.active {
  display: block;
}

/* ============================================
   MODAL
   ============================================ */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: var(--container-bg);
  border-radius: 15px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideInUp 0.4s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--primary-cyan);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-light);
  font-size: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.modal-close:hover {
  color: var(--danger-color);
  transform: rotate(90deg);
}

.modal-body {
  padding: 20px;
}

/* ============================================
   ADMIN SIDEBAR
   ============================================ */
.admin-sidebar {
  background: var(--container-bg);
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 20px;
}

.admin-menu {
  list-style: none;
}

.admin-menu li {
  margin-bottom: 10px;
}

.admin-menu a {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  background: var(--card-bg);
  border-radius: 10px;
  color: var(--text-light);
  text-decoration: none;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.admin-menu a:hover,
.admin-menu a.active {
  background: linear-gradient(135deg, var(--primary-purple), var(--primary-cyan));
  border-color: var(--primary-cyan);
  transform: translateX(5px);
}

.admin-menu a i {
  margin-right: 10px;
  font-size: 18px;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.mt-1 {
  margin-top: 5px;
}
.mt-2 {
  margin-top: 10px;
}
.mt-3 {
  margin-top: 15px;
}
.mt-4 {
  margin-top: 20px;
}

.mb-1 {
  margin-bottom: 5px;
}
.mb-2 {
  margin-bottom: 10px;
}
.mb-3 {
  margin-bottom: 15px;
}
.mb-4 {
  margin-bottom: 20px;
}

.p-1 {
  padding: 5px;
}
.p-2 {
  padding: 10px;
}
.p-3 {
  padding: 15px;
}
.p-4 {
  padding: 20px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .admin-container {
    padding: 10px;
  }

  .game-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 769px) {
  .bottom-nav {
    display: none;
  }
}
