/* css/styles.css */

/* Reset muy básico */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", system-ui, sans-serif;
  background: #f5f1e8; /* beige/crema claro como el logo */
  color: #1a1a1a;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.site-header {
  text-align: center;
  padding: 1.5rem 1rem 1rem;
}

.site-logo {
  max-width: 200px;
  width: 100%;
  height: auto;
  margin-bottom: 1rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.site-title {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
}

.site-subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: #666;
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 1rem 2rem;
}

/* Contenedor de sorteos */
.raffles-container {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.raffles-container > p {
  text-align: center;
  color: #666;
  padding: 2rem 1rem;
  font-size: 0.95rem;
}

/* Tarjetas */
.raffle-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border: 0.5px solid rgba(0, 0, 0, 0.04);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.raffle-card.expanded {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.08);
}

.raffle-card-header {
  margin-bottom: 0.75rem;
}

.raffle-title {
  margin: 0 0 0.375rem;
  font-size: 1.15rem;
  color: #1a1a1a;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.raffle-subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: #3a3a3a;
  letter-spacing: -0.003em;
}

.raffle-card-expandable {
  margin-top: 0.5rem;
}

.raffle-read-more-btn {
  background: transparent;
  border: none;
  color: #dc2626;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.5rem 0;
  text-decoration: none;
  transition: opacity 0.2s ease;
  letter-spacing: -0.003em;
}

.raffle-read-more-btn:hover {
  opacity: 0.8;
}

.raffle-read-more-btn:active {
  opacity: 0.6;
}

.raffle-card-content {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.raffle-description {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: #444;
  line-height: 1.5;
}

.raffle-requirements {
  margin: 0 0 1rem;
  padding: 0.75rem;
  background: #f9f9f9;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #555;
  line-height: 1.6;
  border-left: 3px solid #dc2626;
}

.raffle-required-action {
  margin: 0 0 1rem;
  padding: 1rem;
  background: #fff5f5;
  border-radius: 8px;
  border: 1px solid #fecaca;
}

.required-action-title {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: #1a1a1a;
  font-weight: 600;
}

.required-action-description {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: #444;
  line-height: 1.5;
}

.required-action-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 0.75rem 0;
  border: 1px solid #e5e5e5;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.required-action-link-wrapper {
  margin-top: 0.75rem;
}

.required-action-link {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: #dc2626;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s ease;
  width: 100%;
  text-align: center;
}

.required-action-link:hover {
  background: #c41e1e;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.required-action-warning {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: #fef3c7;
  border: 1.5px solid #f59e0b;
  border-radius: 10px;
  font-size: 0.85rem;
  color: #92400e;
  font-weight: 500;
  text-align: center;
  line-height: 1.4;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.1);
}

/* Botón principal */
.raffle-btn,
.close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1.4rem;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.raffle-btn {
  background: #dc2626; /* rojo vibrante KAI como el Daruma */
  color: #fff;
  font-weight: 600;
  width: 100%;
  margin-top: 0.5rem;
}

.raffle-btn:hover {
  background: #c41e1e;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.raffle-btn:active {
  background: #b91c1c;
  transform: translateY(0);
}

/* Modal */
.raffle-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
}

.raffle-modal.hidden {
  display: none;
}

.raffle-modal-content {
  background: #ffffff;
  border-radius: 20px;
  padding: 1.5rem;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  border: 0.5px solid rgba(0, 0, 0, 0.04);
  position: relative;
}

.close-btn {
  background: #f5f5f5;
  color: #1a1a1a;
  margin-bottom: 1rem;
  width: 100%;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.close-btn:hover {
  background: #e8e8e8;
  border-color: rgba(0, 0, 0, 0.12);
}

.close-btn:active {
  background: #e0e0e0;
  transform: scale(0.98);
}

.raffle-modal-title {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  color: #1a1a1a;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.raffle-modal-description {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: #3a3a3a;
  line-height: 1.6;
  letter-spacing: -0.003em;
}

.description-toggle {
  background: none;
  border: none;
  color: #dc2626;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.25rem 0;
  margin-top: 0.5rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: opacity 0.2s ease;
}

.description-toggle:hover {
  opacity: 0.8;
}

.description-toggle:active {
  opacity: 0.6;
}

.raffle-modal-iframe-wrapper {
  width: 100%;
  min-height: 200px;
  display: flex;
  flex-direction: column;
}

.iframe-loading-message {
  padding: 2rem 1.5rem;
  text-align: center;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  order: 2;
  transition: padding 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              min-height 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.iframe-loading-message.moved-up {
  padding: 1rem 1.25rem;
  min-height: auto;
  order: 1;
  margin-bottom: 0.75rem;
}

.loading-text {
  font-size: 0.9rem;
  color: #3a3a3a;
  line-height: 1.5;
  margin: 0;
  padding: 1rem 1.25rem;
  background: #fafafa;
  border-radius: 12px;
  border-left: 3px solid #dc2626;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  width: 100%;
  letter-spacing: -0.003em;
}

.loading-spinner {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 1rem 0;
  min-height: 60px;
}

.loading-spinner::after {
  content: "";
  width: 40px;
  height: 40px;
  border: 4px solid #f3f4f6;
  border-top-color: #dc2626;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: block;
}

.iframe-loading-message.moved-up .loading-spinner {
  margin-top: 0.75rem;
  min-height: 50px;
  padding: 0.5rem 0;
}

.iframe-loading-message.moved-up .loading-spinner::after {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

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

.iframe-loading-message.moved-up .loading-text {
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  background: #fff5f5;
  border-left: 3px solid #dc2626;
  border-radius: 10px;
}

.iframe-container {
  width: 100%;
  animation: fadeIn 0.4s ease;
  order: 2;
  display: none;
}

.iframe-loading-message.moved-up ~ .iframe-container {
  order: 2;
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* iFrame de Airtable */
.airtable-embed {
  border-radius: 12px;
  width: 100%;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 3rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.site-footer a {
  color: #dc2626;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* Pequeño ajuste para pantallas grandes */
@media (min-width: 768px) {
  .site-logo {
    max-width: 250px;
  }

  .site-title {
    font-size: 1.8rem;
  }

  .raffles-container {
    max-width: 600px;
  }

  .raffle-card {
    padding: 1.5rem;
  }
}

