/* Main Styles for Striker Splash */

/* General Styles */
body {
  font-family: "Roboto", sans-serif;
  color: #333;
  font-size: 16px; /* Base font size for better mobile readability */
}

.section {
  padding: 2rem 0; /* Reduced for mobile */
}

/* Mobile-first responsive sections */
@media (min-width: 768px) {
  .section {
    padding: 4rem 0;
  }
}

.section-title {
  text-align: center;
  margin-bottom: 2rem; /* Reduced for mobile */
  position: relative;
  font-size: 1.75rem; /* Smaller on mobile */
}

/* Responsive section titles */
@media (min-width: 768px) {
  .section-title {
    margin-bottom: 3rem;
    font-size: 2.5rem;
  }
}

.section-title:after {
  content: "";
  display: block;
  width: 60px; /* Smaller on mobile */
  height: 3px;
  background: #007bff;
  margin: 10px auto;
}

@media (min-width: 768px) {
  .section-title:after {
    width: 80px;
    height: 4px;
    margin: 15px auto;
  }
}

/* Hero Section */
.hero {
  background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)),
    url("/images/hero-bg.jpg");
  background-size: cover;
  background-position: center;
  color: white;
  text-align: center;
  padding: 4rem 0; /* Smaller on mobile */
}

/* Responsive hero section */
@media (min-width: 768px) {
  .hero {
    padding: 8rem 0;
  }
}

.hero h1 {
  font-size: 2rem; /* Smaller on mobile */
  margin-bottom: 1rem;
  line-height: 1.2;
}

/* Responsive hero title */
@media (min-width: 576px) {
  .hero h1 {
    font-size: 2.5rem;
  }
}

@media (min-width: 768px) {
  .hero h1 {
    font-size: 3.5rem;
  }
}

/* How to Play Section */
.step-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 1.5rem; /* Smaller padding on mobile */
  text-align: center;
  transition: transform 0.3s;
  height: 100%;
  margin-bottom: 1rem; /* Add margin for mobile stacking */
}

/* Responsive step cards */
@media (min-width: 768px) {
  .step-card {
    padding: 2rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 0;
  }
}

.step-card:hover {
  transform: translateY(-5px);
}

/* Disable hover effect on touch devices */
@media (hover: none) {
  .step-card:hover {
    transform: none;
  }
}

.step-number {
  display: inline-block;
  width: 35px; /* Smaller on mobile */
  height: 35px;
  line-height: 35px;
  border-radius: 50%;
  background: #007bff;
  color: white;
  font-weight: bold;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

/* Responsive step numbers */
@media (min-width: 768px) {
  .step-number {
    width: 40px;
    height: 40px;
    line-height: 40px;
    margin-bottom: 1rem;
    font-size: 1rem;
  }
}

/* Mobile-friendly card titles */
.step-card h4 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

@media (min-width: 768px) {
  .step-card h4 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }
}

/* Enhanced Leaderboard Section */
.leaderboard-table {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  overflow: hidden;
  overflow-x: auto;
}

/* Enhanced mobile table wrapper */
.table-responsive {
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Enhanced responsive table adjustments */
@media (max-width: 767px) {
  .table-responsive table {
    min-width: 700px; /* Increased minimum width for better readability */
  }

  .table th,
  .table td {
    padding: 0.75rem 0.5rem; /* Improved padding for mobile */
    font-size: 0.9rem; /* Slightly larger font on mobile */
  }

  .table th {
    white-space: nowrap;
    font-weight: 600;
  }

  /* Mobile card improvements */
  .card.mb-3 {
    margin-bottom: 1.5rem !important;
  }

  .badge {
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
  }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 991px) {
  .table th,
  .table td {
    padding: 1rem 0.75rem;
    font-size: 0.95rem;
  }

  .badge {
    padding: 0.6rem 1.2rem;
  }
}

/* Desktop improvements */
@media (min-width: 992px) {
  .table th,
  .table td {
    padding: 1.25rem 1rem;
  }
}

.leaderboard-row:nth-child(1) {
  background-color: #ffd700;
}

.leaderboard-row:nth-child(2) {
  background-color: #c0c0c0;
}

.leaderboard-row:nth-child(3) {
  background-color: #cd7f32;
}

/* QR Code Styles */
.qr-container {
  max-width: 200px; /* Smaller on mobile */
  margin: 0 auto;
}

@media (min-width: 768px) {
  .qr-container {
    max-width: 250px;
  }
}

.qr-code {
  width: 100%;
  height: auto;
  border: 1px solid #ddd;
  padding: 8px; /* Smaller padding on mobile */
  background: white;
  border-radius: 4px;
}

@media (min-width: 768px) {
  .qr-code {
    padding: 10px;
  }
}

/* Player Dashboard */
.stats-card {
  border-left: 4px solid #007bff;
  margin-bottom: 1rem; /* Add margin for mobile stacking */
}

/* Staff Interface */
.scan-container {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 15px; /* Smaller padding on mobile */
  background: #f9f9f9;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .scan-container {
    padding: 20px;
  }
}

.player-info {
  min-height: 200px; /* Smaller on mobile */
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1rem;
}

@media (min-width: 768px) {
  .player-info {
    min-height: 300px;
  }
}

/* Admin Dashboard */
.stat-card {
  border-radius: 8px;
  padding: 15px; /* Smaller padding on mobile */
  margin-bottom: 15px;
  color: white;
}

@media (min-width: 768px) {
  .stat-card {
    padding: 20px;
    margin-bottom: 20px;
  }
}

.stat-card.primary {
  background: linear-gradient(45deg, #007bff, #0056b3);
}

.stat-card.success {
  background: linear-gradient(45deg, #28a745, #1e7e34);
}

.stat-card.warning {
  background: linear-gradient(45deg, #ffc107, #d39e00);
}

.stat-card.danger {
  background: linear-gradient(45deg, #dc3545, #bd2130);
}

.stat-icon {
  font-size: 2rem; /* Smaller on mobile */
  opacity: 0.7;
}

@media (min-width: 768px) {
  .stat-icon {
    font-size: 3rem;
  }
}

/* Mobile-specific enhancements */

/* Touch-friendly buttons */
@media (max-width: 767px) {
  .btn {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    min-height: 44px; /* iOS recommended touch target */
  }

  .btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    min-height: 38px;
  }

  .btn-lg {
    padding: 1rem 1.5rem;
    font-size: 1.125rem;
    min-height: 50px;
  }
}

/* Mobile navigation enhancements */
@media (max-width: 991px) {
  .navbar-nav .nav-link {
    padding: 0.75rem 1rem;
    font-size: 1.1rem;
  }

  .navbar-nav .dropdown-menu {
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  }
}

/* Mobile card improvements */
@media (max-width: 767px) {
  .card {
    margin-bottom: 1rem;
  }

  .card-body {
    padding: 1rem;
  }

  .card-header {
    padding: 0.75rem 1rem;
  }

  .card-header h3,
  .card-header h4 {
    font-size: 1.25rem;
    margin-bottom: 0;
  }
}

/* Mobile form improvements */
@media (max-width: 767px) {
  .form-control {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 0.75rem;
    min-height: 44px;
  }

  .form-select {
    font-size: 16px;
    padding: 0.75rem;
    min-height: 44px;
  }

  .form-label {
    font-weight: 600;
    margin-bottom: 0.25rem;
  }
}

/* Mobile table alternatives - card view for small screens */
@media (max-width: 576px) {
  .mobile-card-view .table {
    display: none;
  }

  .mobile-card-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }

  .mobile-card-item .item-title {
    font-weight: bold;
    color: #007bff;
    margin-bottom: 0.5rem;
  }

  .mobile-card-item .item-detail {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
  }

  .mobile-card-item .item-detail strong {
    display: inline-block;
    min-width: 80px;
    color: #666;
  }
}

/* Responsive spacing utilities */
@media (max-width: 767px) {
  .mobile-px-2 {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }
  .mobile-py-2 {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
  }
  .mobile-mb-3 {
    margin-bottom: 1rem !important;
  }
  .mobile-mt-3 {
    margin-top: 1rem !important;
  }
}

/* Responsive grid adjustments */
@media (max-width: 767px) {
  .row > div[class*="col-"] {
    margin-bottom: 1rem;
  }

  .row > div[class*="col-"]:last-child {
    margin-bottom: 0;
  }
}

/* Sticky elements for mobile */
@media (max-width: 767px) {
  .mobile-sticky-top {
    position: sticky;
    top: 76px; /* Account for navbar height */
    z-index: 1020;
    background: white;
    padding: 0.5rem;
    border-bottom: 1px solid #dee2e6;
  }
}

/* Loading states for mobile */
.mobile-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  font-size: 1.1rem;
  color: #666;
}

/* Mobile-friendly modals */
@media (max-width: 767px) {
  .modal-dialog {
    margin: 0.5rem;
    max-width: calc(100% - 1rem);
  }

  .modal-content {
    border-radius: 8px;
  }

  .modal-header {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
  }

  .modal-body {
    padding: 1rem;
  }

  .modal-footer {
    padding: 1rem;
    border-top: 1px solid #dee2e6;
  }
}

/* Team competition modals */
.modal {
  overflow-y: auto;
}

/* Team player selector */
#team-player-selector {
  max-height: 40vh;
  overflow-y: auto;
}

#team-player-selector-container {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

/* Active player styles */
.player-selectable {
  transition: all 0.2s ease;
}

.player-selectable[data-active="true"] {
  border-left: 4px solid #198754;
}

.player-selectable[data-active="false"] {
  opacity: 0.7;
}

/* Desktop layout fixes for staff dashboard */
@media (min-width: 768px) {
  /* Container spacing fix for staff dashboard */
  .container-fluid.mt-3 {
    padding-left: 2rem;
    padding-right: 2rem;
    max-width: 1200px;
    margin: 0 auto;
  }

  /* Staff dashboard card styling to match competition setup */
  .card-body {
    padding: 1.5rem;
  }

  /* Make consistent card heights */
  .card-body .row .col-md-4 .card,
  .card-body .row .col-md-6 .card,
  .card-body .row .col-lg-4 .card {
    height: 100%;
  }

  /* Button width fixes for desktop - prevent full width on larger screens */
  .card-body .btn {
    padding: 0.5rem 1.5rem;
  }

  .card-body .btn.w-100,
  .card-body .btn.btn-success,
  .card-body .btn.btn-primary,
  .card-body .btn.btn-warning,
  .card-body .btn.btn-secondary {
    width: auto !important;
    min-width: 120px;
    max-width: none;
    display: inline-block;
  }

  /* Staff dashboard specific spacing */
  .card.mb-4 {
    margin-bottom: 2rem !important;
  }

  /* Queue status card specific margins */
  .card .alert {
    margin-bottom: 1rem;
  }

  /* Better card spacing within dashboard */
  .card-body .row .col-lg-4,
  .card-body .row .col-md-6,
  .card-body .row .col-md-4 {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Large desktop improvements */
@media (min-width: 992px) {
  .container-fluid.mt-3 {
    padding-left: 3rem;
    padding-right: 3rem;
    max-width: 1400px;
  }

  /* Make staff dashboard match competition setup */
  .container.mt-4,
  .container-fluid.mt-3 {
    max-width: 1200px;
  }

  /* Better spacing for large screens */
  .card.mb-4 {
    margin-bottom: 2.5rem !important;
  }

  /* Make icons consistent */
  .card-body i.bi {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
  }

  /* More spacing between dashboard cards */
  .card-body .row .col-lg-4,
  .card-body .row .col-md-6,
  .card-body .row .col-md-4 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  /* Card titles and text spacing */
  .card-body h4,
  .card-body h5 {
    margin-top: 1rem;
    margin-bottom: 0.75rem;
  }

  .card-body p {
    margin-bottom: 1.5rem;
  }
}

/* Extra large desktop - fix consistency issues */
@media (min-width: 1200px) {
  /* Fixed container width for better consistency */
  .container-fluid.mt-3,
  .container.mt-4 {
    max-width: 1140px;
    margin: 0 auto;
    padding-left: 2rem;
    padding-right: 2rem;
  }

  /* Card consistency */
  .card {
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
  }

  .card-header {
    padding: 1rem 1.5rem;
  }

  /* Consistent spacing in staff interface */
  .staff-dashboard .card-body,
  .competition-setup .card-body {
    padding: 2rem;
  }

  /* Fix for cards in staff dashboard row */
  .card-body .row {
    margin-left: -1rem;
    margin-right: -1rem;
  }

  /* Fix button styling */
  .btn {
    border-radius: 0.25rem;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
  }

  /* Equal height cards */
  .card-body .card {
    height: 100%;
    display: flex;
    flex-direction: column;
  }

  .card-body .card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  .card-body .card .btn {
    margin-top: auto;
  }
}

/* Competition specific styles */
/* Team player selection styling */
#team-player-selection-container {
  background-color: #f8f9fa;
  padding: 1.5rem;
  border-radius: 0.5rem;
  margin-top: 1.5rem;
  border: 1px solid #e9ecef;
}

.player-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 1rem;
}

.player-selection-item {
  border: 1px solid #dee2e6;
  border-radius: 5px;
  padding: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: #fff;
}

.player-selection-item:hover {
  border-color: #adb5bd;
  background-color: #f8f9fa;
}

.player-selection-item.selected {
  background-color: #d4edda;
  border-color: #28a745;
}

/* Improved card for team competition setup */
.competition-setup .card {
  overflow: visible;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border-radius: 8px;
}

.competition-setup .card-header {
  padding: 1rem 1.25rem;
  font-weight: 500;
}

.competition-setup .card-body {
  padding: 1.5rem;
}

/* Team player selection styling */
.player-selectable {
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.player-selectable:hover {
  border-color: #adb5bd;
}

.player-selectable[data-active="true"] {
  border-color: #28a745;
  background-color: #f8fff9;
}

.player-selectable[data-active="false"] {
  opacity: 0.75;
}

.player-selectable .form-check-input {
  cursor: pointer;
  width: 20px;
  height: 20px;
}

#teamMembersModal .modal-body {
  max-height: 70vh;
  overflow-y: auto;
}

#active-players-count {
  font-weight: bold;
  color: #28a745;
}

/* Add highlight effect for newly selected players */
@keyframes highlightCard {
  0% {
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.8);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
  }
}

.player-selectable.highlight {
  animation: highlightCard 1s ease-in-out;
}
