:root {
  --primary: #4a6cf7;
  --primary-light: #e8edff;
  --primary-dark: #3a5bd9;
  --secondary: #6c757d;
  --success: #28a745;
  --info: #17a2b8;
  --warning: #ffc107;
  --danger: #dc3545;
  --light: #f8f9fa;
  --dark: #1e293b;
  --darker: #0f172a;
  --ink: #2d3748;
  --muted: #64748b;
  --text-light: #f8fafc;
  --text-muted: #94a3b8;
}

/* Estructura general */
body {
  font-family: 'Poppins', sans-serif;
  color: var(--ink);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Merriweather', serif;
  font-weight: 700;
}

/*  Header  */
header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.brand-icon {
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  font-size: 1.5rem;
  transition: all 0.3s ease;
}

.brand-icon:hover {
  transform: rotate(15deg) scale(1.05);
}

/* ===== Formulario y tarjetas ===== */
.card {
  border-radius: 12px;
  overflow: hidden;
  border: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
}

.form-control, .form-select {
  border-radius: 8px;
  padding: 0.75rem 1rem;
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.25rem rgba(74, 108, 247, 0.25);
}

.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(74, 108, 247, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Tarjeta de libro  */
.book-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  padding: 1.5rem;
  height: 100%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.book-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
}

.book-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
  transition: width 0.3s ease;
}

.book-card:hover::after {
  width: 6px;
}

.book-title {
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.book-author {
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 0.75rem;
  display: block;
}

.book-year {
  background: var(--primary-light);
  color: var(--primary);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-block;
}

/* Loader*/
.loader {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.loader .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  animation: bounce 1.2s ease-in-out infinite;
}

.loader .dot:nth-child(2) {
  animation-delay: 0.2s;
}

.loader .dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
    opacity: 0.6;
  }
  50% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

/* ===== Alertas ===== */
.alert {
  border-radius: 8px;
  padding: 1rem 1.25rem;
  border: none;
}

.alert-icon {
  font-size: 1.25rem;
  margin-right: 0.75rem;
}

.skeleton-card {
  height: 180px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 12px;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Footer  */
.site-footer {
  background: var(--darker);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand-icon {
  width: 44px;
  height: 44px;
  font-size: 1.1rem;
  transition: transform 0.3s ease;
}

.footer-brand-icon:hover {
  transform: rotate(15deg);
}

.icon-container {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-link {
  display: flex;
  align-items: center;
  padding: 0.25rem;
  border-radius: 50px;
  transition: all 0.3s ease;
}

.footer-link:hover {
  background: rgba(255, 255, 255, 0.1);
}

.footer-link:hover .icon-container {
  transform: translateY(-3px) scale(1.1);
  box-shadow: 0 4px 8px rgba(255, 255, 255, 0.2);
}

/* Texto de enlaces */
.link-text {
  color: white;
  transition: color 0.3s ease;
}

.footer-link:hover .link-text {
  color: var(--primary-light);
}

.footer-link::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.footer-link:hover::after {
  opacity: 1;
}

/* Responsividad */
@media (max-width: 767.98px) {
  .footer-links {
    justify-content: center !important;
    margin: 1.5rem 0;
  }

  .footer-link {
    padding: 0.5rem;
  }

  .icon-container {
    width: 40px;
    height: 40px;
  }
}
.footer-link {
  position: relative;
}

@media (max-width: 767.98px) {
  .site-footer .row > .col-md-4:first-child {
    text-align: center;
  }
  .site-footer .row > .col-md-4:first-child .d-flex {
    justify-content: center;
    align-items: center;
    text-align: center;
  }
}

@media (max-width: 575.98px) {
  .book-title { font-size: 1.1rem; }
  .book-card { padding: 1.25rem; }
}
