/* styles.css - Modern Mobile-first Design */

/* Import a distinctive font */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* Reset and base styles */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body.theme {
  margin: 0;
  padding: 0;
  font-family: 'Outfit', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-color) url('football-boxes-bg.webp') no-repeat center center fixed;
  background-size: cover;
  color: var(--text-color);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  min-height: 100vh;
}

/* Overlay for better readability */
body.theme::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.4) 0%,
    rgba(0, 0, 0, 0.6) 50%,
    rgba(0, 0, 0, 0.7) 100%
  );
  pointer-events: none;
  z-index: 0;
}

/* Mobile-first container */
.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.container.narrow {
  max-width: 420px;
}

/* Typography - modern and bold */
h1 {
  margin: 0 0 0.75rem 0;
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
  color: #FFD700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

h2 {
  margin: 1.5rem 0 0.75rem 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.subtitle {
  margin: 0 0 1.5rem 0;
  font-size: 0.9rem;
  font-weight: 400;
  opacity: 0.9;
  text-align: center;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.3);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.subtitle strong {
  color: #FF6B6B;
  font-weight: 600;
}

/* Title image container */
.title-image {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.title-image img {
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Cards - glassmorphism style */
.card {
  background: rgba(30, 30, 40, 0.7);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Form elements - sleek and modern */
label {
  display: block;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"] {
  width: 100%;
  padding: 0.875rem 1rem;
  margin-top: 0.5rem;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-appearance: none;
  appearance: none;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus {
  outline: none;
  border-color: var(--accent-color);
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 
    0 0 0 4px rgba(255, 140, 0, 0.15),
    0 4px 16px rgba(255, 140, 0, 0.1);
}

input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* Buttons - bold and modern */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.75rem;
  border-radius: 50px;
  border: none;
  background: linear-gradient(135deg, #FF8C00 0%, #FF6347 100%);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 48px;
  min-width: 48px;
  box-shadow: 
    0 4px 16px rgba(255, 99, 71, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 
    0 8px 24px rgba(255, 99, 71, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn-danger {
  background: linear-gradient(135deg, #DC3545 0%, #8B0000 100%);
  box-shadow: 0 4px 16px rgba(220, 53, 69, 0.3);
}

.btn-square {
  width: 100%;
  padding: 0.5rem 0.6rem;
  font-size: 0.85rem;
  border-radius: 10px;
  min-height: 40px;
}

.btn-football {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0;
  font-size: 1.1rem;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  background: rgba(139, 69, 19, 0.6);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 40px;
  text-shadow:
    0 2px 4px rgba(0,0,0,0.8),
    0 0 20px rgba(255, 215, 0, 0.5);
  z-index: 2;
  overflow: hidden;
}

.btn-football::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: 80%;
  background: url('football_icon.webp') no-repeat center center;
  background-size: contain;
  opacity: 0.35;
  transition: all 0.25s ease;
  z-index: 1;
}

.btn-football:hover {
  background: rgba(139, 69, 19, 0.8);
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(139, 69, 19, 0.4);
}

.btn-football:hover::before {
  opacity: 0.5;
  transform: translate(-50%, -50%) scale(1.1);
}

.btn-football:active {
  transform: scale(0.95);
}

/* Alerts - modern style */
.alert {
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  font-weight: 500;
  backdrop-filter: blur(10px);
  animation: slideIn 0.3s ease-out;
}

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

.alert-info {
  background: rgba(102, 252, 241, 0.1);
  border: 1px solid rgba(102, 252, 241, 0.4);
  color: #66FCF1;
}

.alert-error {
  background: rgba(255, 70, 70, 0.1);
  border: 1px solid rgba(255, 70, 70, 0.5);
  color: #FF6B6B;
}

/* Board - modern glass effect */
.board-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
  -webkit-overflow-scrolling: touch;
  border-radius: 16px;
  padding: 3px;
  background: linear-gradient(135deg, rgba(255,140,0,0.3), rgba(255,99,71,0.3));
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 60px rgba(255, 140, 0, 0.1);
}

.board {
  border-collapse: collapse;
  margin: 0 auto;
  background: rgba(20, 20, 30, 0.9);
  backdrop-filter: blur(20px);
  border-radius: 14px;
  overflow: hidden;
  min-width: 320px;
  font-size: 0.8rem;
  table-layout: fixed;
}

.board th,
.board td {
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
  vertical-align: middle;
}

/* Team Names Row - vibrant accent */
.team-row .corner-cell,
.team-row .team-cell {
  background: linear-gradient(135deg, #FF8C00 0%, #FF6347 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.7rem;
  height: 24px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.team-row .corner-cell {
  width: 24px;
  min-width: 24px;
  background: rgba(30, 30, 40, 0.8);
}

.team-row .team-cell {
  width: 66px;
  min-width: 66px;
}

/* Left column team cells */
.team-cell-left {
  width: 24px;
  min-width: 24px;
  height: 66px;
  background: linear-gradient(180deg, #FF8C00 0%, #FF6347 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.65rem;
  text-align: center;
  vertical-align: middle;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Numbers Row - sleek dark */
.corner-cell {
  width: 24px;
  min-width: 24px;
  height: 60px;
  background: rgba(40, 40, 50, 0.9);
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
  font-size: 0.8rem;
  text-align: center;
  vertical-align: middle;
  flex-shrink: 0;
}

.header-cell {
  width: 66px;
  min-width: 66px;
  height: 66px;
  font-weight: 700;
  font-size: 1.2rem;
  background: rgba(40, 40, 50, 0.9);
  color: #FFD700;
  text-align: center;
  vertical-align: middle;
  flex-shrink: 0;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

/* Square sizing - modern with hover effects */
.square {
  width: 66px;
  height: 66px;
  position: relative;
  min-width: 66px;
  min-height: 66px;
  transition: all 0.2s ease;
}

.square.available {
  background: rgba(255, 255, 255, 0.03);
}

.square.available:hover {
  background: rgba(255, 140, 0, 0.1);
}

.square.taken {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.08) 0%, rgba(255, 140, 0, 0.08) 100%);
}

.square-content {
  padding: 0.25rem;
  font-size: 0.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
}

.square-name {
  font-weight: 600;
  margin-bottom: 0.15rem;
  word-break: break-word;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.95);
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 50px;
  font-size: 0.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge.paid {
  background: linear-gradient(135deg, rgba(0, 200, 83, 0.25) 0%, rgba(0, 150, 60, 0.25) 100%);
  border: 1px solid rgba(0, 200, 83, 0.6);
  color: #00C853;
}

.badge.unpaid {
  background: linear-gradient(135deg, rgba(255, 196, 0, 0.2) 0%, rgba(255, 140, 0, 0.2) 100%);
  border: 1px solid rgba(255, 196, 0, 0.6);
  color: #FFC400;
}

.square-form {
  margin: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem;
}

/* Admin table - modern dark theme */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
  background: rgba(30, 30, 40, 0.8);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.admin-table th,
.admin-table td {
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.6rem 0.5rem;
  text-align: left;
}

.admin-table th {
  background: rgba(255, 140, 0, 0.15);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #FF8C00;
}

.admin-table td:first-child,
.admin-table th:first-child {
  width: 15%;
}

.admin-table td:nth-child(2) {
  width: 15%;
}

.admin-table td:nth-child(3) {
  width: 50%;
}

.admin-table td:last-child {
  width: 20%;
  text-align: center;
}

/* Footer note - subtle glass */
.footer-note {
  margin-top: 2rem;
  font-size: 0.85rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.3);
  padding: 1rem 1.25rem;
  border-radius: 12px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Winners Section - premium design */
.winners-section {
  margin-top: 3rem;
  padding: 2rem 0;
}

.winners-section h2 {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 2rem;
  color: #FFD700;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.winners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  max-width: 1000px;
  margin: 0 auto;
}

.winner-card {
  background: rgba(30, 30, 40, 0.7);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.3s ease;
}

.winner-card:hover {
  transform: translateY(-4px);
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(255, 140, 0, 0.1);
}

.winner-card h3 {
  color: #fff;
  margin: 0 0 0.75rem 0;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.8;
}

.prize-info {
  margin-bottom: 1rem;
  text-align: center;
}

.prize-amount {
  font-size: 1.75rem;
  font-weight: 800;
  color: #00C853;
  margin-bottom: 0.25rem;
}

.prize-percentage {
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
}

.winner-info {
  color: #fff;
}

.winner-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: #FFD700;
}

.winner-square {
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0.7;
}

.no-winner {
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
  padding: 0.5rem 0;
  font-size: 0.9rem;
}

.prize-disclaimer {
  margin-top: 2rem;
  text-align: center;
  padding: 1rem 1.25rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.prize-disclaimer p {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Responsive breakpoints */
@media (min-width: 480px) {
  .container {
    padding: 2rem 1.5rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  .square {
    width: 70px;
    height: 70px;
    min-width: 70px;
    min-height: 70px;
  }

  .team-row .corner-cell,
  .team-row .team-cell {
    height: 24px;
    font-size: 0.65rem;
  }

  .team-row .team-cell {
    width: 70px;
    min-width: 70px;
  }

  .team-row .corner-cell {
    width: 24px;
    min-width: 24px;
  }

  .header-cell {
    width: 70px;
    min-width: 70px;
    height: 70px;
    font-size: 1.1rem;
  }

  .corner-cell {
    width: 24px;
    min-width: 24px;
    height: 55px;
    font-size: 0.7rem;
  }

  .team-cell-left {
    width: 24px;
    min-width: 24px;
    font-size: 0.6rem;
    height: 70px;
  }

  .btn-square {
    font-size: 0.9rem;
  }
}

@media (min-width: 768px) {
  .container {
    padding: 2.5rem 2rem;
  }

  h1 {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .square {
    width: 78px;
    height: 78px;
    min-width: 78px;
    min-height: 78px;
  }

  .team-row .corner-cell,
  .team-row .team-cell {
    height: 24px;
    font-size: 0.7rem;
  }

  .team-row .team-cell {
    width: 78px;
    min-width: 78px;
  }

  .team-row .corner-cell {
    width: 24px;
    min-width: 24px;
  }

  .header-cell {
    width: 78px;
    min-width: 78px;
    height: 78px;
    font-size: 1.3rem;
  }

  .corner-cell {
    width: 24px;
    min-width: 24px;
    height: 58px;
    font-size: 0.75rem;
  }

  .team-cell-left {
    width: 24px;
    min-width: 24px;
    font-size: 0.65rem;
    height: 78px;
  }

  .square-content {
    font-size: 0.65rem;
  }

  .square-name {
    font-size: 0.7rem;
  }

  .admin-table {
    font-size: 0.9rem;
  }

  .admin-table th,
  .admin-table td {
    padding: 0.75rem 0.6rem;
  }
}

@media (min-width: 1024px) {
  h1 {
    font-size: 2.25rem;
  }

  .board {
    font-size: 0.9rem;
  }

  .square {
    width: 86px;
    height: 86px;
    min-width: 86px;
    min-height: 86px;
  }

  .team-row .corner-cell,
  .team-row .team-cell {
    height: 24px;
    font-size: 0.75rem;
  }

  .team-row .team-cell {
    width: 86px;
    min-width: 86px;
  }

  .team-row .corner-cell {
    width: 24px;
    min-width: 24px;
  }

  .header-cell {
    width: 86px;
    min-width: 86px;
    height: 86px;
    font-size: 1.5rem;
  }

  .corner-cell {
    width: 24px;
    min-width: 24px;
    height: 65px;
    font-size: 0.85rem;
  }

  .team-cell-left {
    width: 24px;
    min-width: 24px;
    font-size: 0.7rem;
    height: 86px;
  }

  .square-content {
    font-size: 0.7rem;
  }

  .square-name {
    font-size: 0.75rem;
  }

  .badge {
    font-size: 0.55rem;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .btn:hover {
    transform: none;
  }

  .square {
    min-width: 54px;
    min-height: 54px;
  }

  input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin: 0 auto;
    accent-color: var(--accent-color);
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .square.available {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.4);
  }

  .square.taken {
    background: rgba(248, 208, 120, 0.3);
    border: 2px solid rgba(248, 208, 120, 0.6);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .btn,
  input[type="text"],
  input[type="password"],
  .square,
  .winner-card,
  .title-image img {
    transition: none;
    animation: none;
  }
}

/* Responsive winners grid */
@media (max-width: 768px) {
  .winners-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
}

@media (max-width: 520px) {
  .winners-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* Admin navigation */
.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: center;
  justify-content: space-between;
}

.view-toggle {
  display: flex;
  gap: 0.5rem;
}

.btn-toggle {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  min-height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-toggle.active {
  background: linear-gradient(135deg, #FF8C00 0%, #FF6347 100%);
  border-color: transparent;
}
