/* ============================================
   TAP Awards - Main Stylesheet
   ============================================
   All colors use CSS variables from themes.css
   for easy theme switching
   ============================================ */

/* ============================================
   BASE STYLES
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  transition: background-color var(--transition-normal), color var(--transition-normal);
  min-height: 100vh;
}

/* Login page with background image */
body.login-page {
  background-image: url('/images/super12.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  margin-bottom: var(--space-md);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }

p {
  margin-top: 0;
  margin-bottom: var(--space-md);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-hover);
}

/* ============================================
   PAGE HEADER - Gradient Banner
   ============================================ */
.page-header {
  padding: var(--space-xl) var(--space-md);
  margin-bottom: var(--space-xl);
  background: var(--gradient-header);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

.page-header h1 {
  margin-bottom: 0;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
  position: relative;
  z-index: 1;
}

.page-header h1 b {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================
   BUTTONS - Modern with Gradients
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-xl);
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left var(--transition-slow);
}

.btn:hover::before {
  left: 100%;
}

.btn:focus {
  outline: none;
  box-shadow: var(--shadow-glow);
}

.btn-primary {
  color: #ffffff;
  background: var(--gradient-primary);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Menu Buttons - Cards with hover effects */
.menu-button {
  display: block;
  width: 100%;
  padding: var(--space-lg) var(--space-xl);
  margin-bottom: var(--space-sm);
  font-family: var(--font-sans);
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-text);
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.menu-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--gradient-primary);
  transform: scaleY(0);
  transition: transform var(--transition-fast);
}

.menu-button:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-lg);
  transform: translateX(4px);
}

.menu-button:hover::before {
  transform: scaleY(1);
}

.menu-button:active {
  transform: translateX(2px);
}

/* ============================================
   FORMS - Polished inputs
   ============================================ */
.form-control {
  display: block;
  width: 100%;
  padding: var(--space-md);
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-glow);
}

.form-group {
  margin-bottom: var(--space-lg);
}

.form-group label {
  display: block;
  margin-bottom: var(--space-sm);
  font-weight: 600;
  color: var(--color-text);
}

.help-block {
  margin-top: var(--space-xs);
  font-size: var(--font-size-sm);
  color: var(--color-error);
}

.has-error .form-control {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px rgb(239 68 68 / 0.15);
}

select {
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-glow);
}

select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

input[type="text"],
input[type="password"],
input[type="email"] {
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-glow);
}

/* ============================================
   TABLES - Clean modern style
   ============================================ */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
}

table, th, td {
  border: 1px solid var(--color-border);
}

th, td {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
}

th {
  font-weight: 600;
  background: var(--gradient-primary);
  color: #ffffff;
  text-transform: uppercase;
  font-size: var(--font-size-sm);
  letter-spacing: 0.05em;
}

tbody tr {
  transition: background-color var(--transition-fast);
}

tbody tr:hover {
  background-color: var(--color-surface-alt);
}

/* ============================================
   CARDS & CONTAINERS
   ============================================ */
.wrapper {
  max-width: 420px;
  margin: var(--space-xl) auto;
  padding: var(--space-xl);
  background-color: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--color-border);
}

/* Wrapper on login page */
.login-page .wrapper {
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.5);
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,0.95);
}

.theme-dark .login-page .wrapper {
  background: rgba(30, 41, 59, 0.95);
}

/* ============================================
   COMPETITION LIST
   ============================================ */
.comp_list {
  max-width: 450px;
  margin: 0 auto var(--space-md);
  padding: 0 var(--space-md);
}

.comp_list a {
  text-decoration: none;
}

/* ============================================
   NAVIGATION MENU
   ============================================ */
.pick_menu {
  max-width: 320px;
  margin: var(--space-md) auto;
  padding: var(--space-lg);
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
}

.pick_menu_hide {
  display: none;
}

nav.pick_menu a,
nav.pick_menu_hide a {
  display: block;
  margin-bottom: var(--space-sm);
}

/* ============================================
   GAME LIST - Cards with team display
   ============================================ */
.game_list {
  max-width: 800px;
  margin: var(--space-lg) auto;
  background: var(--color-game-bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.game_list th {
  background: var(--gradient-primary);
  color: #ffffff;
  text-align: center;
  padding: var(--space-lg);
  font-size: var(--font-size-xl);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.game_list td {
  text-align: center;
  vertical-align: middle;
  padding: var(--space-md);
  border-color: var(--color-border);
  font-weight: 500;
}

.round_hide {
  display: none;
}

/* ============================================
   PICKS SECTION - Gradient background
   ============================================ */
.picks {
  max-width: 800px;
  margin: 0 auto var(--space-lg);
  padding: var(--space-lg);
  background: var(--color-picks-bg);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  text-align: center;
  border: 1px solid var(--color-border);
  border-top: none;
}

.picks table {
  width: 100%;
  background-color: transparent;
  border: none;
}

.picks td {
  padding: var(--space-sm);
  border: none;
  font-size: var(--font-size-sm);
}

/* ============================================
   TEAM LOGOS - Circular with border
   ============================================ */
.logo {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  padding: 4px;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-fast);
}

.logo:hover {
  transform: scale(1.1);
}

/* ============================================
   LEADERBOARD - Podium style
   ============================================ */
.leaderboard {
  max-width: 100%;
  margin: var(--space-lg) auto;
  padding: var(--space-lg);
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow-x: auto;
  border: 1px solid var(--color-border);
}

.leaderboard table {
  min-width: 100%;
}

.leaderboard th {
  background: var(--gradient-primary);
  color: #ffffff;
  font-size: var(--font-size-sm);
  white-space: nowrap;
  padding: var(--space-md);
}

.leaderboard td {
  text-align: center;
  font-size: var(--font-size-sm);
  padding: var(--space-sm) var(--space-md);
}

/* Podium positions with icons (nth-child(2) = 1st data row after header) */
.leaderboard tbody tr:nth-child(2) td:first-child {
  font-weight: 700;
  position: relative;
}

.leaderboard tbody tr:nth-child(2) td:first-child::before {
  content: '🥇 ';
}

.leaderboard tbody tr:nth-child(3) td:first-child {
  font-weight: 600;
}

.leaderboard tbody tr:nth-child(3) td:first-child::before {
  content: '🥈 ';
}

.leaderboard tbody tr:nth-child(4) td:first-child {
  font-weight: 600;
}

.leaderboard tbody tr:nth-child(4) td:first-child::before {
  content: '🥉 ';
}

/* ============================================
   RESULTS - Winner highlighting
   ============================================ */
.winner {
  background: var(--gradient-gold) !important;
  color: #1e293b;
  font-weight: 700;
}

.loser {
  opacity: 0.6;
}

.correct {
  background: var(--gradient-success) !important;
  color: #ffffff;
  font-weight: 600;
}

.resultlist {
  max-width: 100%;
  margin: var(--space-lg) auto;
  text-align: center;
  overflow-x: auto;
}

.resultlist table {
  margin: 0 auto;
}

/* ============================================
   PICKS LIST
   ============================================ */
.picklist {
  max-width: 100%;
  margin: var(--space-lg) auto;
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow-x: auto;
  border: 1px solid var(--color-border);
}

.picklist th {
  background: var(--gradient-primary);
  color: #ffffff;
  font-size: var(--font-size-sm);
  padding: var(--space-md);
}

.picklist td {
  text-align: center;
  font-size: var(--font-size-sm);
  padding: var(--space-sm) var(--space-md);
}

/* ============================================
   RULES - Clean card layout
   ============================================ */
.rules {
  max-width: 700px;
  margin: var(--space-xl) auto;
  padding: var(--space-xl);
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  text-align: left;
  border: 1px solid var(--color-border);
}

.rules td {
  padding: var(--space-md);
  border: none;
  border-bottom: 1px solid var(--color-border);
}

.rules tr:last-child td {
  border-bottom: none;
}

.rules li {
  margin-bottom: var(--space-xs);
}

#rule-table td {
  border: none;
  padding: var(--space-sm) var(--space-md);
}

.option {
  font-size: var(--font-size-sm);
  font-style: italic;
  color: var(--color-text-muted);
}

/* ============================================
   MEMBER DETAILS
   ============================================ */
.member {
  max-width: 500px;
  margin: var(--space-xl) auto;
  padding: var(--space-xl);
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
}

.member .text1 {
  display: inline-block;
  width: 130px;
  font-weight: 600;
  color: var(--color-text);
}

.member input {
  margin-bottom: var(--space-sm);
}

/* ============================================
   TEAM LIST
   ============================================ */
.teamlist {
  max-width: 800px;
  margin: var(--space-xl) auto;
  padding: var(--space-lg);
}

.teamlist table {
  width: 100%;
}

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

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.comp_list {
  animation: fadeIn var(--transition-slow) ease-out;
}

.game_list {
  animation: fadeIn var(--transition-slow) ease-out;
}

/* ============================================
   SAVE CONFIRMATION PANEL
   ============================================ */
.save-confirmation {
  max-width: 600px;
  margin: var(--space-md) auto var(--space-lg);
  padding: 0;
  background: var(--color-success-bg);
  border: 2px solid var(--color-success);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: slideDown 0.3s ease-out;
}

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

.save-confirmation-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: var(--color-success);
  color: #ffffff;
  font-weight: 600;
  font-size: var(--font-size-lg);
}

.save-confirmation-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(255,255,255,0.2);
  border-radius: var(--radius-full);
  font-size: var(--font-size-lg);
}

.save-confirmation-close {
  margin-left: auto;
  background: none;
  border: none;
  color: #ffffff;
  font-size: var(--font-size-2xl);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
  line-height: 1;
}

.save-confirmation-close:hover {
  opacity: 1;
}

.save-confirmation-list {
  margin: 0;
  padding: var(--space-md) var(--space-lg);
  list-style: none;
}

.save-confirmation-list li {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: var(--font-size-sm);
}

.save-confirmation-list li:last-child {
  border-bottom: none;
}

.save-confirmation-list li::before {
  content: '\2713';
  display: inline-block;
  margin-right: var(--space-sm);
  color: var(--color-success);
  font-weight: bold;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media screen and (max-width: 800px) {
  body {
    font-size: var(--font-size-sm);
  }

  .page-header {
    padding: var(--space-lg) var(--space-md);
  }

  .page-header h1 {
    font-size: var(--font-size-xl);
  }

  .game_list,
  .picks,
  .picklist {
    max-width: 100%;
    margin-left: var(--space-sm);
    margin-right: var(--space-sm);
    border-radius: var(--radius-lg);
  }

  .picks table {
    display: block;
  }

  .picks td {
    display: block;
    width: 100%;
    padding: var(--space-xs);
  }

  .leaderboard {
    padding: var(--space-md);
    margin: var(--space-sm);
  }

  .leaderboard th,
  .leaderboard td {
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--font-size-xs);
  }

  .comp_list {
    padding: 0 var(--space-sm);
  }

  .wrapper {
    margin: var(--space-md);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
  }

  .rules {
    margin: var(--space-md);
    padding: var(--space-lg);
  }

  .logo {
    width: 45px;
    height: 45px;
  }

  .menu-button {
    padding: var(--space-md) var(--space-lg);
  }

  .theme-switcher {
    bottom: var(--space-md);
    right: var(--space-md);
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--font-size-xs);
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .theme-switcher,
  .pick_menu,
  .btn {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .page-header {
    background: #333;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
