/*--------------------------------------------------------------
# Campeonatos Section - Custom Styles
--------------------------------------------------------------*/

.campeonatos-section {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  padding: 80px 0;
  position: relative;
  overflow: hidden;
}

.campeonatos-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 300px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  clip-path: polygon(0 0, 100% 0, 100% 70%, 0 100%);
  z-index: 0;
}

.campeonatos-section > .container {
  position: relative;
  z-index: 1;
}

/* Section Header Styles */
.section-header-campeonatos {
  margin-bottom: 40px;
}

.header-badge-wrapper {
  margin-bottom: 20px;
}

.header-badge {
  display: inline-block;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 8px 25px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  animation: fadeInDown 0.6s ease-out;
}

.section-main-title {
  font-size: 2.8rem;
  font-weight: 800;
  color: #2d3748;
  margin: 25px 0 20px;
  line-height: 1.2;
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

.section-main-title i {
  font-size: 2.5rem;
  vertical-align: middle;
  animation: bounce 2s ease-in-out infinite;
}

.section-description {
  font-size: 1.15rem;
  color: #64748b;
  line-height: 1.6;
  max-width: 700px;
  margin: 0 auto 30px;
  animation: fadeInUp 0.6s ease-out 0.4s both;
}

.header-divider {
  position: relative;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, #667eea 50%, transparent 100%);
  margin: 30px auto 0;
  max-width: 300px;
  border-radius: 3px;
  animation: fadeInUp 0.6s ease-out 0.6s both;
}

.divider-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  padding: 0 15px;
  color: #667eea;
  font-size: 1.2rem;
}

/* Season Banner Styles */
.season-banner {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  padding: 25px 35px;
  box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.6s ease-out 0.8s both;
}

.season-banner::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  border-radius: 50%;
}

.season-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  z-index: 1;
}

.season-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.2);
  padding: 12px 25px;
  border-radius: 15px;
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255,255,255,0.3);
}

.season-badge i {
  font-size: 2rem;
  color: #fff;
}

.season-badge span {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 2px;
}

.season-text {
  flex: 1;
  text-align: left;
}

.season-text h3 {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 5px 0;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.season-text p {
  color: rgba(255,255,255,0.9);
  margin: 0;
  font-size: 0.95rem;
}

.season-status {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.95);
  padding: 10px 20px;
  border-radius: 25px;
  font-weight: 600;
  color: #667eea;
  white-space: nowrap;
}

.status-dot {
  width: 10px;
  height: 10px;
  background: #10b981;
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

/* Championship Cards - Minimalista con Borde Superior */
.championship-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  height: 100%;
  border-top: 5px solid #0d6efd;
  position: relative;
}

.championship-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 35px rgba(0,0,0,0.15);
}

/* Colores base por categoría - Mayor especificidad */
.championship-card.pista-card {
  border-top-color: #dc3545 !important;
}

.championship-card.pista-card:hover {
  box-shadow: 0 12px 35px rgba(220, 53, 69, 0.2);
}

.championship-card.karting-card {
  border-top-color: #0d6efd !important;
}

.championship-card.karting-card:hover {
  box-shadow: 0 12px 35px rgba(13, 110, 253, 0.2);
}

/* Animación de cambio de borde según estado del semáforo de carreras */
/* ROJO (falta mucho) → AMARILLO (prepararse) → VERDE (¡largada!) */
/* Estos efectos aplican principalmente al countdown circle, manteniendo el color base de la categoría en el borde */
.championship-card:has(.countdown-circle.estado-seguro) {
  box-shadow: 0 4px 25px rgba(40, 167, 69, 0.15);
}

.championship-card:has(.countdown-circle.estado-critico) {
  box-shadow: 0 6px 30px rgba(15, 138, 46, 0.25);
  animation: card-urgent-pulse 2s ease-in-out infinite;
}

@keyframes card-urgent-pulse {
  0%, 100% {
    box-shadow: 0 6px 30px rgba(15, 138, 46, 0.25);
  }
  50% {
    box-shadow: 0 8px 40px rgba(15, 138, 46, 0.4);
  }
}

.card-header-custom {
  background: #f8f9fa;
  padding: 20px 25px;
  display: flex;
  align-items: center;
  gap: 15px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  border-top: 3px solid #0d6efd;
}

.pista-card .card-header-custom {
  background: linear-gradient(to right, rgba(220, 53, 69, 0.05) 0%, #f8f9fa 100%);
  border-top-color: #dc3545;
}

.karting-card .card-header-custom {
  background: linear-gradient(to right, rgba(13, 110, 253, 0.05) 0%, #f8f9fa 100%);
  border-top-color: #0d6efd;
}

.icon-wrapper {
  width: 60px;
  height: 60px;
  background: #fff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  flex-shrink: 0;
}

.pista-card .icon-wrapper {
  color: #dc3545;
  border: 2px solid rgba(220, 53, 69, 0.2);
}

.karting-card .icon-wrapper {
  color: #0d6efd;
  border: 2px solid rgba(13, 110, 253, 0.2);
}

.card-header-custom h4 {
  color: #212529;
  font-weight: 700;
  font-size: 1.4rem;
  line-height: 1.3;
}

.card-header-custom .badge {
  font-size: 0.75rem;
  padding: 6px 14px;
  font-weight: 600;
  border-radius: 20px;
}

/* Image Title Overlay - Netflix Style */
.image-title-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 70%, transparent 100%);
  padding: 25px 30px;
  z-index: 2;
  transition: all 0.3s ease;
  pointer-events: none;
}

.championship-card:hover .image-title-overlay {
  background: linear-gradient(to bottom, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.3) 70%, transparent 100%);
}

.title-content {
  display: flex;
  align-items: center;
  gap: 15px;
}

.icon-wrapper-overlay {
  width: 50px;
  height: 50px;
  background: rgba(255,255,255,0.95);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
}

.championship-card:hover .icon-wrapper-overlay {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.pista-card .icon-wrapper-overlay {
  color: #dc3545;
  border: 2px solid rgba(220, 53, 69, 0.3);
}

.karting-card .icon-wrapper-overlay {
  color: #0d6efd;
  border: 2px solid rgba(13, 110, 253, 0.3);
}

.image-title-overlay h4 {
  color: #fff;
  font-weight: 700;
  font-size: 1.4rem;
  line-height: 1.3;
  margin: 0;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.image-title-overlay .badge {
  font-size: 0.75rem;
  padding: 6px 14px;
  font-weight: 600;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.2);
  transition: all 0.3s ease;
}

/* Badge changes with traffic light system */
.championship-card:has(.countdown-circle.estado-seguro) .image-title-overlay .badge,
.championship-card:has(.countdown-circle.estado-critico) .image-title-overlay .badge {
  animation: badge-glow 2s ease-in-out infinite;
}

@keyframes badge-glow {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(0,0,0,0.3), 0 0 0 rgba(255,255,255,0.5);
  }
  50% {
    box-shadow: 0 4px 12px rgba(0,0,0,0.4), 0 0 15px rgba(255,255,255,0.8);
  }
}

.card-body-custom {
  padding: 30px;
  position: relative;
  transition: all 0.3s ease;
}

/* Efecto visual adicional en estados críticos */
.card-body-custom:has(.countdown-circle.estado-critico) {
  background: linear-gradient(to bottom, rgba(15, 138, 46, 0.02) 0%, rgba(255,255,255,1) 50%);
}

.card-body-custom:has(.countdown-circle.estado-seguro) {
  background: linear-gradient(to bottom, rgba(40, 167, 69, 0.02) 0%, rgba(255,255,255,1) 50%);
}

/* Event Status Badges - Traffic Light System */
.event-status-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: none;
  z-index: 3;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.countdown-circle.estado-seguro ~ .countdown-container .event-status-badge,
.countdown-circle.estado-critico ~ .countdown-container .event-status-badge {
  display: inline-block;
}

/* Mostrar badge cuando el countdown está en verde (¡cerca!) */
.card-body-custom:has(.countdown-circle.estado-seguro) .event-status-badge,
.card-body-custom:has(.countdown-circle.estado-critico) .event-status-badge {
  display: inline-block;
}

.card-body-custom:has(.countdown-circle.estado-seguro) .event-status-badge {
  background: linear-gradient(135deg, #28a745 0%, #218838 100%);
  color: #fff;
  animation: badge-pulse 2s ease-in-out infinite;
}

.card-body-custom:has(.countdown-circle.estado-critico) .event-status-badge {
  background: linear-gradient(135deg, #0f8a2e 0%, #0d7028 100%);
  color: #fff;
  animation: badge-pulse-fast 1s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.6);
  }
}

@keyframes badge-pulse-fast {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 6px 15px rgba(15, 138, 46, 0.5);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 8px 25px rgba(15, 138, 46, 0.8);
  }
}

.section-subtitle {
  color: #495057;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.download-section {
  margin-bottom: 20px;
}

/* Enhanced Download Buttons */
.btn-download {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.3s ease;
  border-width: 2px;
  text-align: left;
}

.btn-download:hover {
  transform: translateX(5px);
  box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.btn-download i:first-child {
  font-size: 1.5rem;
}

.btn-download span {
  flex: 1;
}

.btn-download i:last-child {
  font-size: 1.2rem;
}

/* Accordion Custom Styles */
.accordion-custom {
  margin-top: 30px;
}

.accordion-custom .accordion-item {
  border: none;
  margin-bottom: 20px;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
}

.accordion-custom .accordion-item:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.accordion-custom .accordion-button {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  color: #212529;
  font-weight: 600;
  font-size: 1.1rem;
  padding: 20px 25px;
  border: none;
  box-shadow: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.accordion-custom .accordion-button:not(.collapsed) {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  box-shadow: none;
}

.accordion-custom .accordion-button:focus {
  box-shadow: none;
  border: none;
}

.accordion-custom .accordion-button::after {
  background-size: 1.5rem;
  width: 1.5rem;
  height: 1.5rem;
}

.accordion-custom .accordion-button:not(.collapsed)::after {
  filter: brightness(0) invert(1);
}

.accordion-custom .accordion-body {
  padding: 30px;
  background: #fff;
}

/* Date Item Styles */
.date-item {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 15px;
  border-left: 4px solid #0d6efd;
  transition: all 0.3s ease;
}

.date-item:hover {
  background: #e9ecef;
  transform: translateX(5px);
  box-shadow: 0 3px 15px rgba(0,0,0,0.1);
}

.date-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  flex-wrap: wrap;
  gap: 10px;
}

.date-badge {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 8px 20px;
  border-radius: 25px;
  font-weight: 700;
  font-size: 1rem;
  display: inline-block;
  box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.date-count {
  background: #e9ecef;
  color: #495057;
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.date-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.date-downloads .btn {
  margin: 0;
  transition: all 0.3s ease;
}

.date-downloads .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Weight Tables Button Group */
.btn-group-weights {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 2px dashed #dee2e6;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-group-weights .btn {
  font-size: 0.85rem;
  padding: 5px 12px;
}

/* Historical Championships Header */
.historical-header {
  background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
  border-radius: 20px;
  padding: 25px 35px;
  margin-bottom: 30px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.6s ease-out;
}

.historical-header::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
  border-radius: 50%;
}

.historical-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  z-index: 1;
}

.historical-icon {
  width: 60px;
  height: 60px;
  background: rgba(255,255,255,0.1);
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
}

.historical-icon i {
  font-size: 2rem;
  color: #fff;
}

.historical-text {
  flex: 1;
  text-align: left;
}

.historical-text h3 {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 5px 0;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.historical-text p {
  color: rgba(255,255,255,0.85);
  margin: 0;
  font-size: 0.95rem;
}

.historical-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.15);
  padding: 10px 20px;
  border-radius: 25px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
}

.historical-badge i {
  font-size: 1.2rem;
}

/* Responsive Design */
@media (max-width: 991px) {
  .championship-card {
    margin-bottom: 30px;
  }
  
  .card-header-custom {
    flex-direction: column;
    text-align: center;
  }
  
  .section-main-title {
    font-size: 2.2rem;
  }
  
  .season-content {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }
  
  .season-text {
    text-align: center;
    width: 100%;
  }
  
  .historical-content {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }
  
  .historical-text {
    text-align: center;
    width: 100%;
  }
}

@media (max-width: 768px) {
  .campeonatos-section {
    padding: 60px 0;
  }
  
  .section-main-title {
    font-size: 1.8rem;
  }
  
  .section-main-title i {
    font-size: 1.8rem;
  }
  
  .section-description {
    font-size: 1rem;
  }
  
  .season-banner {
    padding: 20px 25px;
  }
  
  .season-badge {
    width: 100%;
    justify-content: center;
  }
  
  .season-badge span {
    font-size: 1.5rem;
  }
  
  .season-text h3 {
    font-size: 1.2rem;
  }
  
  .season-status {
    width: 100%;
    justify-content: center;
  }
  
  .historical-header {
    padding: 20px 25px;
  }
  
  .historical-content {
    gap: 15px;
  }
  
  .historical-icon {
    width: 50px;
    height: 50px;
  }
  
  .historical-icon i {
    font-size: 1.5rem;
  }
  
  .historical-text h3 {
    font-size: 1.2rem;
  }
  
  .btn-download {
    font-size: 0.9rem;
    padding: 12px 15px;
  }
  
  .date-item {
    padding: 15px;
  }
  
  .date-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .date-downloads {
    width: 100%;
  }
  
  .date-downloads .btn {
    width: 100%;
  }
  
  .btn-group-weights {
    flex-direction: column;
  }
  
  .btn-group-weights .btn {
    width: 100%;
  }
}

@media (max-width: 576px) {
  .campeonatos-section {
    padding: 50px 0;
  }
  
  .header-badge {
    font-size: 0.75rem;
    padding: 6px 20px;
  }
  
  .section-main-title {
    font-size: 1.5rem;
  }
  
  .section-main-title i {
    font-size: 1.5rem;
  }
  
  .section-description {
    font-size: 0.9rem;
  }
  
  .season-banner {
    padding: 15px 20px;
  }
  
  .season-badge i {
    font-size: 1.5rem;
  }
  
  .season-badge span {
    font-size: 1.3rem;
  }
  
  .historical-header {
    padding: 15px 20px;
  }
  
  .card-header-custom h4 {
    font-size: 1.2rem;
  }
  
  .icon-wrapper {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }
  
  .section-subtitle {
    font-size: 1rem;
  }
}

/* Coming Soon / In Progress Styles */
.alert {
  border-radius: 12px;
  border: none;
}

.alert-info {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  color: #01579b;
}

.alert-success {
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  color: #1b5e20;
}

.alert i {
  opacity: 0.8;
}

.championship-card .text-center i.bi-hourglass-split {
  opacity: 0.3;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.05);
  }
}

/* Print Styles */
@media print {
  .championship-card {
    page-break-inside: avoid;
    box-shadow: none;
    border: 1px solid #dee2e6;
  }
  
  .btn-download {
    display: flex;
  }
}
