/* ==========================================================
   The Matches Club - Modern Cricket Sports Design (Light Mode)
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Oswald:wght@500;600;700&display=swap');

:root {
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Oswald', sans-serif;
  
  /* Light Mode Palette */
  --bg-page: #f8fafc;
  --bg-page-alt: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-input: #ffffff;
  
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-glow: rgba(37, 99, 235, 0.2);
  --accent-cricket: #dc2626; /* Cricket ball red */
  --accent-green: #16a34a;  /* Pitch green */
  --accent-gold: #f59e0b;   /* Trophy gold */
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --border-subtle: #e2e8f0;
  --border-input: #cbd5e1;
  --border-focus: #3b82f6;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-card: 0 10px 25px -5px rgba(15, 23, 42, 0.06), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-card-hover: 0 20px 30px -10px rgba(37, 99, 235, 0.12), 0 10px 15px -5px rgba(0, 0, 0, 0.04);
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 90px; /* space for mobile bottom nav */
  background-image: 
    radial-gradient(at 10% 10%, rgba(37, 99, 235, 0.03) 0px, transparent 50%),
    radial-gradient(at 90% 90%, rgba(22, 163, 74, 0.03) 0px, transparent 50%);
}

@media (max-width: 991.98px) {
  main {
    padding-bottom: 2rem !important;
  }
}

@media (min-width: 992px) {
  body {
    padding-bottom: 0;
  }
}

/* Typography */
h1, h2, h3, .brand-font {
  font-family: var(--font-heading);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-main);
}

/* Navbar (Crisp White Light Theme) */
.navbar-tmc {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.brand-badge {
  background: linear-gradient(135deg, #f59e0b 0%, #dc2626 100%);
  color: #fff;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  letter-spacing: 0.5px;
  display: inline-block;
  margin-left: 6px;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.25);
}

.navbar-nav .nav-link {
  color: #334155;
  font-weight: 600;
  font-size: 0.92rem;
  transition: all 0.2s ease;
}

.navbar-nav .nav-link:hover, .navbar-nav .nav-link.active {
  color: var(--primary) !important;
}

/* Cards & Containers (Light Theme) */
.card-tmc {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.card-tmc:hover {
  border-color: #bfdbfe;
  box-shadow: var(--shadow-card-hover);
}

.card-header-tmc {
  background: #f8fafc;
  border-bottom: 1px solid var(--border-subtle);
  padding: 1.1rem 1.4rem;
}

/* Inputs & Form Controls */
.form-label-tmc {
  font-size: 0.875rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-label-tmc .req-star {
  color: var(--accent-cricket);
}

.form-control-tmc, .form-select-tmc {
  background-color: var(--bg-input);
  border: 1px solid var(--border-input);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.form-control-tmc:focus, .form-select-tmc:focus {
  background-color: #ffffff;
  border-color: var(--border-focus);
  color: var(--text-main);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  outline: none;
}

.form-control-tmc::placeholder {
  color: #94a3b8;
}

.form-control-tmc.text-uppercase, .text-uppercase {
  text-transform: uppercase !important;
}

.form-control-tmc.is-invalid, .is-invalid {
  border-color: #ef4444 !important;
  background-color: #fef2f2 !important;
}

/* Selectable Radio Cards & Pill Chips */
.radio-group-tmc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.radio-pill {
  position: relative;
  cursor: pointer;
  margin-bottom: 0;
}

.radio-pill input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.radio-pill .pill-label {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1.15rem;
  background-color: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  color: #1e293b;
  font-weight: 600;
  font-size: 0.92rem;
  transition: all 0.2s ease;
  user-select: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.radio-pill input[type="radio"]:checked + .pill-label {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  color: #ffffff !important;
  border-color: #1d4ed8;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  font-weight: 700;
}

.radio-pill:hover .pill-label {
  border-color: #2563eb;
  color: #1d4ed8;
  background-color: #eff6ff;
}

/* Photo Upload Box (High Contrast & Clear Readability) */
.photo-upload-box {
  border: 2px dashed #2563eb;
  border-radius: var(--radius-md);
  padding: 1.75rem 1.25rem;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.photo-upload-box:hover, .photo-upload-box.dragover {
  border-color: #1d4ed8;
  background: #eff6ff;
}

.upload-prompt-title {
  color: #0f172a !important;
  font-weight: 700;
  font-size: 1.05rem;
  margin-top: 0.4rem;
}

.upload-prompt-sub {
  color: #334155 !important;
  font-weight: 600;
  font-size: 0.85rem;
  margin-top: 0.2rem;
}

.photo-preview-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.photo-preview-img {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 12px;
  border: 3px solid var(--primary);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

/* Cropper Modal Styling */
.crop-container {
  width: 100%;
  max-height: 380px;
  background: #0f172a;
  overflow: hidden;
  border-radius: 8px;
}
.crop-container img {
  max-width: 100%;
  display: block;
}

/* Buttons */
.btn-tmc-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border: none;
  color: #fff;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: all 0.2s ease;
}

.btn-tmc-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.btn-tmc-outline {
  background: #ffffff;
  border: 1px solid var(--border-input);
  color: #334155;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.btn-tmc-outline:hover {
  background: #f8fafc;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-tmc-outline.btn-sm,
.btn-tmc-primary.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.84rem;
  line-height: 1.35;
}

/* Player Card Action Buttons Group */
.player-card-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-subtle);
}

.btn-player-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  text-decoration: none;
  min-height: 33px;
  height: 33px;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.btn-player-action:hover {
  transform: translateY(-1px);
}

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

.btn-player-view {
  flex: 0 0 auto;
  padding: 0.45rem 0.65rem;
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #334155 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-player-view i {
  color: #64748b;
  transition: transform 0.2s ease;
}

.btn-player-view:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.btn-player-card {
  flex: 1 1 auto;
  background: #f0fdf4;
  border-color: #86efac;
  color: #15803d !important;
  box-shadow: 0 1px 2px rgba(22, 163, 74, 0.05);
}

.btn-player-card i {
  color: #16a34a;
  transition: transform 0.2s ease;
}

.btn-player-card:hover {
  background: #dcfce7;
  border-color: #4ade80;
  color: #166534 !important;
  box-shadow: 0 3px 8px rgba(22, 163, 74, 0.15);
}

.btn-player-edit {
  flex: 0 0 auto;
  padding: 0.45rem 0.65rem;
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8 !important;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.05);
}

.btn-player-edit i {
  color: #2563eb;
  transition: transform 0.2s ease;
}

.btn-player-edit:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e40af !important;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.15);
}

/* Admin Action Header & Button Group */
.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-admin-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.25;
  padding: 0.48rem 0.95rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  min-height: 38px;
  border: 1px solid transparent;
}

.btn-admin-action:hover {
  transform: translateY(-1px);
}

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

/* Primary Action (New Match) */
.btn-admin-action-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff !important;
  border-color: #2563eb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.22);
}

.btn-admin-action-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  color: #ffffff !important;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.32);
}

/* Success Action (Download / Export) */
.btn-admin-action-success {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  color: #ffffff !important;
  border-color: #16a34a;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.22);
}

.btn-admin-action-success:hover {
  background: linear-gradient(135deg, #15803d 0%, #166534 100%);
  color: #ffffff !important;
  box-shadow: 0 6px 16px rgba(22, 163, 74, 0.32);
}

/* Outline Action (Admin Accounts) */
.btn-admin-action-outline {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #1e293b !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.btn-admin-action-outline i {
  color: #2563eb;
  transition: transform 0.2s ease;
}

.btn-admin-action-outline:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8 !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}

.btn-admin-action-outline:hover i {
  transform: scale(1.12);
}

/* Pending Approvals Action */
.btn-admin-action-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e !important;
  box-shadow: 0 1px 3px rgba(245, 158, 11, 0.08);
}

.btn-admin-action-warning i {
  color: #d97706;
}

.btn-admin-action-warning:hover {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #78350f !important;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.18);
}

.btn-admin-action-warning .badge-counter {
  background: #f59e0b;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: 9999px;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.btn-admin-action-warning.has-pending {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412 !important;
}

.btn-admin-action-warning.has-pending .badge-counter {
  background: #ea580c;
  animation: pulse-soft 2s infinite ease-in-out;
}

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

/* Mobile responsive layout */
@media (max-width: 575.98px) {
  .admin-header-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    width: 100%;
  }

  .admin-header-actions .btn-admin-primary-full {
    grid-column: 1 / -1;
    order: -1;
  }

  .btn-admin-action {
    width: 100%;
    min-height: 42px;
    padding: 0.5rem 0.5rem;
    font-size: 0.8rem;
    justify-content: center;
    text-align: center;
  }
}


/* Badges */
.badge-status {
  padding: 0.4em 0.85em;
  font-weight: 700;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-approved { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.badge-pending { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.badge-rejected { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }

/* Light Mode Tables */
.table-tmc {
  color: var(--text-main);
  background-color: #ffffff;
}

.table-tmc thead th {
  background-color: #f8fafc;
  color: #64748b;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  border-bottom: 2px solid var(--border-subtle);
  padding: 0.85rem 1rem;
}

.table-tmc tbody td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.table-tmc tbody tr:hover {
  background-color: #f8fafc;
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 1040;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.04);
}

.nav-item-mobile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #64748b;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  transition: color 0.2s ease;
  flex: 1;
  height: 100%;
}

.nav-item-mobile i {
  font-size: 1.2rem;
  margin-bottom: 3px;
}

.nav-item-mobile.active, .nav-item-mobile:hover {
  color: var(--primary);
}

@media (min-width: 992px) {
  .mobile-bottom-nav {
    display: none !important;
  }
}

/* PIN Input Boxes */
.pin-input-container {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.pin-digit {
  width: 56px;
  height: 62px;
  font-size: 2rem;
  font-weight: 800;
  text-align: center;
  background: #ffffff;
  border: 2px solid var(--border-input);
  border-radius: var(--radius-md);
  color: #0f172a;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.pin-digit:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
  outline: none;
}

/* Cricket Hero Graphic Showcase */
.cricket-hero-frame {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.05);
  background: #ffffff;
}

.cricket-hero-img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.4s ease;
}

.cricket-hero-frame:hover .cricket-hero-img {
  transform: scale(1.02);
}

.cricket-floating-pill {
  position: absolute;
  bottom: 16px;
  left: 16px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  color: #0f172a;
}
