/* DAB Football Pool Custom Styles */

/* Global Styles */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f8fafc;
}

/* Navigation */
.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
}

.navbar-nav .nav-link {
  font-weight: 500;
  transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
  color: #fbbf24 !important;
}

/* Mobile Navigation Improvements */
@media (max-width: 991.98px) {
  .navbar-brand {
    font-size: 1.25rem;
  }
  
  .navbar-nav {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .navbar-nav .nav-item {
    margin-bottom: 0.5rem;
  }
  
  .navbar-nav .nav-link {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
  }
  
  .navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
  }
}

/* Cards */
.card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-header {
  border-radius: 12px 12px 0 0 !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.125);
  font-weight: 600;
}

/* Mobile Card Improvements */
@media (max-width: 768px) {
  .card-body {
    padding: 1rem;
  }
  
  .card-header {
    padding: 0.75rem 1rem;
  }
  
  .card-footer {
    padding: 0.75rem 1rem;
  }
}

/* Buttons */
.btn {
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, #2563eb 100%);
  border: none;
}

.btn-success {
  background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
  border: none;
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
  border: none;
}

/* Mobile Button Improvements */
@media (max-width: 768px) {
  .btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
  }
  
  .btn-lg {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
  }
  
  .btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
  }
  
  /* Stack button groups vertically on mobile */
  .btn-group {
    flex-direction: column;
    width: 100%;
  }
  
  .btn-group .btn {
    border-radius: 8px !important;
    margin-bottom: 0.5rem;
  }
  
  .btn-group .btn:last-child {
    margin-bottom: 0;
  }
  
  /* Make toolbar button groups horizontal but wrap */
  .btn-toolbar .btn-group {
    flex-direction: row;
    width: auto;
    margin-bottom: 0.5rem;
    margin-right: 0.5rem;
  }
  
  .btn-toolbar .btn-group .btn {
    margin-bottom: 0;
    border-radius: 0;
  }
  
  .btn-toolbar .btn-group .btn:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
  }
  
  .btn-toolbar .btn-group .btn:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
  }
}

/* Game Cards */
.game-card {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.game-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.game-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--success-color));
}

.game-card.border-success::before {
  background: var(--success-color);
}

.game-card.border-warning::before {
  background: var(--warning-color);
}

.game-card.border-danger::before {
  background: var(--danger-color);
}

/* Team Logos */
.team-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 50%;
  border: 2px solid #e5e7eb;
  background: white;
  padding: 2px;
  transition: all 0.3s ease;
}

.team-logo:hover {
  transform: scale(1.1);
  border-color: var(--primary-color);
}

/* Mobile Team Logo Improvements */
@media (max-width: 768px) {
  .team-logo {
    width: 32px;
    height: 32px;
  }
  
  .team-info {
    min-width: 80px;
    font-size: 0.9rem;
  }
  
  .team-primary-name,
  .team-secondary-name {
    font-size: 0.85rem;
    line-height: 1.2;
  }
}

/* Pick Radio Buttons */
.pick-radio {
  transform: scale(1.3);
  accent-color: var(--primary-color);
}

/* Mobile Pick Radio Improvements */
@media (max-width: 768px) {
  .pick-radio {
    transform: scale(1.5);
    margin: 0.5rem;
  }
}

/* Game Tiles Mobile Responsiveness */
.game-tile {
  transition: all 0.3s ease;
  border-left: 4px solid #007bff;
}

@media (max-width: 768px) {
  .game-tile {
    margin-bottom: 1rem;
  }
  
  .game-tile .card-body {
    padding: 0.75rem;
  }
  
  .game-tile .row > div {
    margin-bottom: 0.5rem;
  }
  
  .game-tile .row > div:last-child {
    margin-bottom: 0;
  }
  
  /* Stack game elements vertically on small screens */
  .game-tile .row.align-items-center > div {
    text-align: center !important;
  }
  
  .game-tile .col-lg-1 {
    order: 1;
  }
  
  .game-tile .col-lg-2:first-of-type {
    order: 2;
  }
  
  .game-tile .col-lg-2:last-of-type {
    order: 3;
  }
  
  .game-tile .col-lg-2:nth-of-type(3) {
    order: 4;
  }
  
  .game-tile .col-lg-1:last-of-type {
    order: 5;
  }
}

/* Leaderboard */
.leaderboard-table {
  background: white;
  border-radius: 12px;
  overflow: hidden;
}

.leaderboard-table th {
  background: linear-gradient(135deg, var(--primary-color) 0%, #2563eb 100%);
  color: white;
  font-weight: 600;
  border: none;
}

.leaderboard-table td {
  vertical-align: middle;
  border-color: #f1f5f9;
}

.table-warning {
  background-color: #fef3c7 !important;
  animation: highlight 2s ease-in-out;
}

@keyframes highlight {
  0% { background-color: #fef3c7; }
  50% { background-color: #fbbf24; }
  100% { background-color: #fef3c7; }
}

/* Mobile Leaderboard Improvements */
@media (max-width: 768px) {
  .table-responsive {
    font-size: 0.85rem;
  }
  
  .leaderboard-table th,
  .leaderboard-table td {
    padding: 0.5rem 0.25rem;
  }
  
  .avatar-circle {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }
  
  .player-name {
    font-size: 0.9rem;
  }
  
  .badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
  }
  
  /* Hide less important columns on very small screens */
/*  @media (max-width: 576px) {
    .table th:nth-child(3),
    .table td:nth-child(3),
    .table th:nth-child(4),
    .table td:nth-child(4),
    .table th:nth-child(5),
    .table td:nth-child(5) {
      display: none;
    }
  }*/
}

/* Progress Bars */
.progress {
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar {
  background: linear-gradient(90deg, var(--success-color), #34d399);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Badges */
.badge {
  font-weight: 500;
  font-size: 0.75em;
  border-radius: 6px;
}

/* Avatar Circle */
.avatar-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  flex-shrink: 0;
}

/* Medals and Rankings */
.medal-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.medal-text {
  font-size: 0.75rem;
  font-weight: bold;
}

.season-medal {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  justify-content: center;
}

.season-medal.champion {
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #92400e;
}

.season-medal.second {
  background: linear-gradient(135deg, #c0c0c0, #e5e7eb);
  color: #374151;
}

.season-medal.third {
  background: linear-gradient(135deg, #cd7f32, #d97706);
  color: #white;
}

.rank-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-weight: bold;
  color: #374151;
  background-color: #f3f4f6;
}

.rank-badge.top-ten {
  background: linear-gradient(135deg, var(--primary-color), #3b82f6);
  color: white;
}

/* Mobile Medal and Ranking Improvements */
@media (max-width: 768px) {
  .season-medal {
    width: 48px;
    height: 48px;
    font-size: 0.8rem;
  }
  
  .medal-container i {
    font-size: 1.2rem !important;
  }
  
  .rank-badge {
    font-size: 0.8rem;
    padding: 0.2rem 0.4rem;
  }
}

/* Alerts */
.alert {
  border: none;
  border-radius: 10px;
  font-weight: 500;
}

.alert-success {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
}

.alert-warning {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
}

.alert-danger {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
}

/* Loading Spinner */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast {
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Form Controls */
.form-control, .form-select {
  border-radius: 8px;
  border: 1px solid #d1d5db;
  transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(30, 58, 138, 0.25);
}

/* Mobile Form Improvements */
@media (max-width: 768px) {
  .form-control,
  .form-select {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 0.75rem 1rem;
  }
  
  .input-group .form-control {
    font-size: 16px;
  }
  
  .input-group-text {
    padding: 0.75rem 1rem;
  }
}

/* Dashboard Stats */
.stat-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  border: 1px solid #e5e7eb;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.stat-label {
  color: #6b7280;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Mobile Stats Improvements */
@media (max-width: 768px) {
  .stat-card {
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  .stat-value {
    font-size: 1.5rem;
  }
  
  .stat-label {
    font-size: 0.8rem;
  }
}

/* Pool Cards Mobile Responsiveness */
@media (max-width: 768px) {
  .pool-card .card-footer {
    padding: 0.75rem;
  }
  
  .pool-card .card-footer .btn {
    margin-bottom: 0.5rem;
    width: 100%;
  }
  
  .pool-card .card-footer .btn:last-child {
    margin-bottom: 0;
  }
  
  .pool-card .card-footer .d-flex {
    flex-direction: column;
  }
}

/* Mobile Specific Spacing */
@media (max-width: 768px) {
  .container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .row {
    margin-left: -0.75rem;
    margin-right: -0.75rem;
  }
  
  .row > * {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  
  /* Reduce margins for mobile */
  .mb-4 {
    margin-bottom: 1.5rem !important;
  }
  
  .mt-4 {
    margin-top: 1.5rem !important;
  }
  
  .py-5 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }
}

/* Modal Mobile Improvements */
@media (max-width: 768px) {
  .modal-dialog {
    margin: 1rem;
    max-width: calc(100% - 2rem);
  }
  
  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 1rem;
  }
  
  .modal-title {
    font-size: 1.1rem;
  }
}

/* Table Mobile Improvements */
@media (max-width: 768px) {
  .table-responsive {
    border: none;
  }
  
  .table {
    margin-bottom: 0;
  }
  
  .table th,
  .table td {
    padding: 0.5rem 0.25rem;
    font-size: 0.85rem;
  }
  
  .table th {
    font-size: 0.8rem;
  }
}

/* Enhanced Dark Mode Support */

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
  /* Larger touch targets */
  .btn {
    min-height: 44px;
    min-width: 44px;
  }
  
  .pick-radio {
    transform: scale(1.8);
    margin: 1rem;
  }
  
  .nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  
  /* Remove hover effects on touch devices */
  .card:hover,
  .btn:hover,
  .team-logo:hover {
    transform: none;
    box-shadow: inherit;
  }
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

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

.slide-in-left {
  animation: slideInLeft 0.5s ease-out;
}

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

.slide-in-right {
  animation: slideInRight 0.5s ease-out;
}

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

/* Mobile-first responsive breakpoints */
@media (max-width: 575.98px) {
  /* Extra small devices (phones) */
  .display-1, .display-2, .display-3, .display-4 {
    font-size: calc(1.375rem + 1.5vw);
  }
  
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
  h4 { font-size: 1.1rem; }
  h5 { font-size: 1rem; }
  h6 { font-size: 0.9rem; }
}

/* Utility Classes */
.text-gradient {
  background: linear-gradient(135deg, var(--primary-color), var(--success-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.shadow-soft {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.border-gradient {
  border: 2px solid;
  border-image: linear-gradient(135deg, var(--primary-color), var(--success-color)) 1;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus indicators for keyboard navigation */
.btn:focus,
.form-control:focus,
.form-select:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .card {
    border: 2px solid;
  }
  
  .btn {
    border: 2px solid;
  }
}