/* ===================================
   Variables CSS
   =================================== */
:root {
  --tm-primary: var(--wp--preset--color--primary, #7cda24);
  --tm-primary-dark: var(--wp--preset--color--primary-800, #5ab019);
  --tm-success: var(--wp--preset--color--success, #27ae60);
  --tm-danger: var(--wp--preset--color--error, #e74c3c);
  --tm-text: var(--wp--preset--color--foreground, #fafafa);
  --tm-text-light: var(--wp--preset--color--foreground-alt, #ffffff);
  --tm-bg-card: var(#0005);
  --tm-bg-light: var(#0002);
  --tm-border: var(--wp--preset--color--border, #e0e0e0);
  --tm-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --tm-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
  --tm-radius: 8px;
  --tm-radius-sm: 4px;
}

/* ===================================
   Catálogo de Torneos
   =================================== */
.tm-tournament-catalog {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.tm-tournaments-grid {
  display: grid;
  gap: 24px;
  margin-bottom: 30px;
}

.tm-grid-columns-2 {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.tm-grid-columns-3 {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.tm-grid-columns-4 {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

/* ===================================
   Tarjetas de Torneos
   =================================== */
.tm-tournament-card {
  background: var(--tm-bg-card);
  border: 1px solid var(--tm-border);
  border-radius: var(--tm-radius);
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: var(--tm-shadow);
  display: flex;
  flex-direction: column;
}

.tm-tournament-card:hover {
  box-shadow: var(--tm-shadow-hover);
  transform: translateY(-2px);
}

.tm-card-image {
  width: 100%;
  height: 180px;
  overflow: hidden;
  background: #0002;
  border-bottom: 2px solid var(--tm-primary);
}

.tm-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.tm-tournament-card:hover .tm-card-image img {
  transform: scale(1.05);
}

.tm-card-header {
  padding: 20px;
  background: linear-gradient(
    135deg,
    var(--tm-primary) 0%,
    var(--tm-primary-dark) 100%
  );
  color: white;
}

.tm-tournament-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}

.tm-card-body {
  padding: 20px;
  flex: 1;
}

.tm-info-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 14px;
}

.tm-info-row:last-child {
  margin-bottom: 0;
}

.tm-info-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--tm-text-light);
  font-weight: 500;
  min-width: 90px;
}

.tm-info-value {
  color: var(--tm-text);
  font-weight: 600;
}

.tm-remaining-badge {
  font-size: 11px;
  background: #2ecc71;
  color: white;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 5px;
  display: inline-block;
}

.tm-remaining-badge.low-spots {
  background: #e74c3c;
  animation: tm-pulse-red 2s infinite;
}

@keyframes tm-pulse-red {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.tm-vocalia-row {
  color: var(--tm-primary);
  background: rgba(124, 218, 36, 0.1);
  padding: 8px;
  border-radius: 4px;
  border-left: 3px solid var(--tm-primary);
}

.tm-card-footer {
  padding: 20px;
  border-top: 1px solid var(--tm-border);
  background: var(--tm-bg-light);
}

.tm-price {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding: 12px;
  background: var(--tm-bg-card);
  border-radius: var(--tm-radius-sm);
}

.tm-price-label {
  font-size: 13px;
  color: var(--tm-text-light);
  font-weight: 500;
}

.tm-price-amount {
  font-size: 20px;
  font-weight: 700;
  color: var(--tm-primary);
}

/* ===================================
   Página de Detalle del Torneo
   =================================== */
.tm-tournament-detail {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

.tm-detail-header {
  background: linear-gradient(
    135deg,
    var(--tm-primary) 0%,
    var(--tm-primary-dark) 100%
  );
  color: white;
  padding: 30px;
  border-radius: var(--tm-radius);
  margin-bottom: 30px;
}

.tm-detail-title {
  margin: 0 0 15px 0;
  font-size: 32px;
  font-weight: 700;
}

.tm-detail-price {
  font-size: 16px;
}

.tm-detail-price .tm-price-amount {
  font-size: 28px;
  font-weight: 700;
  margin-left: 10px;
}

.tm-detail-body {
  background: var(--tm-bg-card);
  border: 1px solid var(--tm-border);
  border-radius: var(--tm-radius);
  padding: 30px;
}

.tm-detail-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 25px;
  margin-bottom: 30px;
}

.tm-detail-section {
  margin-bottom: 25px;
}

.tm-detail-section h3 {
  margin: 0 0 15px 0;
  font-size: 20px;
  color: var(--tm-primary);
  border-bottom: 2px solid var(--tm-primary);
  padding-bottom: 8px;
}

.tm-detail-section p {
  margin: 8px 0;
  line-height: 1.6;
}

.tm-full-width {
  grid-column: 1 / -1;
}

.tm-content-box {
  background: var(--tm-bg-light);
  padding: 20px;
  border-radius: var(--tm-radius-sm);
  border-left: 4px solid var(--tm-primary);
  line-height: 1.8;
}

.tm-prizes-box {
  border-left-color: #f39c12;
}

.tm-detail-form {
  background: var(--tm-bg-light);
  padding: 25px;
  border-radius: var(--tm-radius);
  margin-top: 30px;
  border: 2px solid var(--tm-primary);
}

.tm-detail-form h3 {
  margin: 0 0 20px 0;
  font-size: 22px;
  color: var(--tm-text);
}

/* ===================================
   Botones
   =================================== */
.tm-button {
  width: 100%;
  padding: 12px 20px;
  border: none;
  border-radius: var(--tm-radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.tm-button-primary {
  background: var(--tm-primary);
  color: white;
}

.tm-button-primary:hover:not(:disabled) {
  background: var(--tm-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124, 218, 36, 0.3);
}

.tm-button-primary:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
}

.tm-button-secondary {
  background: #95a5a6;
  color: white;
}

.tm-button-secondary:hover {
  background: #7f8c8d;
}

.tm-button-large {
  padding: 16px 24px;
  font-size: 18px;
}

.tm-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid white;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: tm-spin 1s linear infinite;
}

@keyframes tm-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===================================
   Formularios
   =================================== */
.tm-form-group {
  margin-bottom: 20px;
}

.tm-form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--tm-text);
}

.tm-required {
  color: var(--tm-danger);
  margin-left: 3px;
}

.tm-input {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--tm-border);
  border-radius: var(--tm-radius-sm);
  font-size: 15px;
  transition: all 0.3s;
}

.tm-input:focus {
  outline: none;
  border-color: var(--tm-primary);
  box-shadow: 0 0 0 3px rgba(124, 218, 36, 0.1);
}

.tm-input-error {
  border-color: var(--tm-danger);
}

.tm-error-message {
  color: var(--tm-danger);
  font-size: 13px;
  margin-top: 5px;
  display: block;
}

.tm-form-message {
  margin-top: 20px;
  padding: 15px;
  border-radius: var(--tm-radius-sm);
}

.tm-message-success {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

.tm-message-error {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

/* ===================================
   Notificaciones
   =================================== */
.tm-notice {
  padding: 20px;
  border-radius: var(--tm-radius);
  margin-bottom: 20px;
  text-align: center;
}

.tm-notice-error {
  background: #fee;
  border: 1px solid #fcc;
  color: #c33;
}

.tm-notice-info {
  background: #e3f2fd;
  border: 1px solid #90caf9;
  color: #1976d2;
}

/* ===================================
   Responsive
   =================================== */
@media (max-width: 768px) {
  .tm-tournaments-grid {
    grid-template-columns: 1fr !important;
  }

  .tm-detail-header {
    padding: 20px;
  }

  .tm-detail-title {
    font-size: 24px;
  }

  .tm-detail-info-grid {
    grid-template-columns: 1fr;
  }

  .tm-detail-body {
    padding: 20px;
  }
}
