/* === Estilos globales con diseño moderno y premiado === */

:root {
  --bg-light: #f3f4f6;
  --bg-dark: #1e293b;
  --text-light: #1f2937;
  --text-dark: #f8fafc;
  --primary: #4f46e5;
  --accent: #9333ea;
  --danger: #ef4444;
  --card-bg-light: #ffffff;
  --card-bg-dark: #1e293b;
  --border-light: #e5e7eb;
  --border-dark: #334155;
  --shadow-light: rgba(0, 0, 0, 0.1);
  --shadow-dark: rgba(0, 0, 0, 0.5);
  --gradient: linear-gradient(135deg, var(--primary), var(--accent));
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--bg-light);
  color: var(--text-light);
  transition: background-color 0.3s ease, color 0.3s ease;
  margin: 0;
  padding: 0;
  line-height: 1.8;
}

body.dark-mode {
  background-color: var(--bg-dark);
  color: var(--text-dark);
}

header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: white;
  color: var(--text-light);
  padding: 2rem 1rem;
  border-bottom: 2px solid var(--border-light);
  box-shadow: 0 4px 10px var(--shadow-light);
}

header .logo {
  max-width: 150px;
  margin-bottom: 1rem;
}

header .title-container {
  text-align: right;
}

h1.display-4 {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0;
  color: var(--primary);
  text-align: center;
}

.header-description {
  font-size: 1rem;
  font-family: 'Inter', sans-serif; /* Modern typography */
  color: var(--text-light);
  margin-top: 0.5rem;
  text-align: center;
  line-height: 1.5;
}

main.container-fluid {
  padding: 2rem 1rem;
}

.card {
  background-color: var(--card-bg-light);
  border: none;
  border-radius: 2rem;
  box-shadow: 0 8px 40px var(--shadow-light);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}

body.dark-mode .card {
  background-color: var(--card-bg-dark);
  box-shadow: 0 8px 40px var(--shadow-dark);
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 16px 50px var(--shadow-light);
}

.card-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
}

.btn {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  border-radius: 1rem;
  font-weight: 600;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn-primary {
  background: var(--gradient);
  border: none;
  color: white;
  box-shadow: 0 4px 15px var(--shadow-light);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent), var(--primary));
  transform: scale(1.1);
  box-shadow: 0 6px 20px var(--shadow-light);
}

.btn-success {
  background: #198754;
  border: none;
}

.btn-outline-primary {
  border: 2px solid var(--primary);
  color: var(--primary);
  background: transparent;
}

.btn-outline-primary:hover {
  background-color: var(--primary);
  color: white;
  transform: scale(1.1);
}

.alert {
  border-radius: 1.5rem;
  padding: 1.5rem;
  margin-top: 2rem;
  font-size: 1.1rem;
  box-shadow: 0 6px 20px var(--shadow-light);
}

.alert-info {
  background-color: #e0f2fe;
  color: #0369a1;
}

.alert-success {
  background-color: #d1fae5;
  color: #065f46;
}

.alert-danger {
  background-color: #fee2e2;
  color: #b91c1c;
}

.ratio {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  margin-top: 2rem;
  margin-bottom: 2rem;
  border: 2px solid var(--border-light);
  border-radius: 2rem;
  overflow: hidden;
  box-shadow: 0 6px 30px var(--shadow-light);
}

body.dark-mode .ratio {
  border: 2px solid var(--border-dark);
  box-shadow: 0 6px 30px var(--shadow-dark);
}

.ratio iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.toggle-darkmode {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: var(--card-bg-light);
  color: var(--text-light);
  border: none;
  border-radius: 50%;
  padding: 1rem;
  box-shadow: 0 6px 15px var(--shadow-light);
  cursor: pointer;
  z-index: 9999;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

body.dark-mode .toggle-darkmode {
  background: var(--card-bg-dark);
  color: var(--text-dark);
  box-shadow: 0 6px 15px var(--shadow-dark);
}

.toggle-darkmode:hover {
  transform: scale(1.2);
}

/* Contenedor horizontal para botones de acciones */
.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 2rem;
  align-items: center;
}

.button-group .btn {
  margin: 0;
}

@media (max-width: 768px) {
  header {
    padding: 1.5rem 1rem;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  header .title-container {
    text-align: center;
    margin-top: 1rem;
  }

  h1.display-4 {
    font-size: 1.5rem;
  }

  .header-description {
    font-size: 0.9rem;
  }

  h1.display-4 {
      font-size: 2.8rem;
  }

  .card-title {
      font-size: 1.5rem;
  }

  .btn {
      font-size: 1rem;
      padding: 0.8rem 1.5rem;
  }

  .ratio {
      padding-top: 75%;
  }
}