@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

:root {
  --bg-color: #0f172a;
  --card-bg: rgba(30, 41, 59, 0.7);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent-color: #3b82f6;
  --accent-hover: #2563eb;
  --border-color: rgba(255, 255, 255, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background-image: radial-gradient(circle at top right, #1e293b, #0f172a);
}

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

.fade-in {
  animation: fadeIn 0.8s ease-out forwards;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Layouts */
.landing-container, .admin-container {
  width: 100%;
  padding: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.landing-card, .admin-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 3rem;
  text-align: center;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.landing-card h1, .admin-card h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  letter-spacing: -0.025em;
}

.landing-card p, .admin-card p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* Spinner */
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-left-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 2rem auto;
}

/* Countdown */
.countdown-display {
  font-size: 4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2rem;
  text-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

/* Links */
.redirect-text a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s;
}

.redirect-text a:hover {
  color: var(--accent-hover);
}

/* Admin Form */
.admin-form {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.admin-form label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.admin-input {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 1.5rem;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.3s;
}

.admin-input:focus {
  outline: none;
  border-color: var(--accent-color);
}

.admin-button {
  background-color: var(--accent-color);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.1s;
  font-family: 'Inter', sans-serif;
}

.admin-button:hover {
  background-color: var(--accent-hover);
}

.admin-button:active {
  transform: scale(0.98);
}

.admin-status {
  margin-top: 1.5rem;
  padding: 1rem;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid var(--accent-color);
  border-radius: 8px;
  color: var(--text-primary) !important;
  font-size: 0.875rem;
}

/* History Section */
.history-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  text-align: left;
}

.history-section h3 {
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.history-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.4);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.2s;
}

.history-item:hover {
  background: rgba(15, 23, 42, 0.7);
}

.history-link {
  font-size: 0.875rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70%;
}

.history-button {
  background-color: transparent;
  color: var(--accent-color);
  border: 1px solid var(--accent-color);
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.history-button:hover {
  background-color: var(--accent-color);
  color: white;
}

/* Stats */
.current-stats {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: -0.75rem;
  margin-bottom: 1.5rem;
}

.current-stats strong {
  color: var(--accent-color);
  font-size: 1rem;
}

.history-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 70%;
  text-align: left;
}

.history-count {
  font-size: 0.75rem;
  color: var(--accent-color);
  font-weight: 600;
}

/* Download Button (Landing) */
.download-button {
  display: inline-block;
  background-color: #ffffff;
  color: #0f172a !important; /* Texto oscuro para contrastar */
  padding: 1rem 2.5rem;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  font-size: 1.25rem;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
  margin-top: 1.5rem;
  border: 2px solid transparent;
}

.download-button:hover {
  background-color: #f8fafc;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(255, 255, 255, 0.35);
}

/* Downloading State */
.download-button.downloading {
  background-color: #22c55e !important; /* Verde vibrante */
  color: #ffffff !important;
  pointer-events: none; /* Evita dobles clics */
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.5);
  transform: scale(0.98);
}
