/* ============================================
   PROMESAS DE PAPEL - Unified Stylesheet
   ============================================ */

/* ============ CSS Variables ============ */
:root {
  /* Primary Colors */
  --color-primary: #009B97;
  --color-primary-dark: #007a70;
  --color-secondary: #C0392B;
  --color-secondary-dark: #9a2e22;

  /* Background Colors */
  --color-bg-light: #F9F7F1;
  --color-bg-dark: #1a1a1a;

  /* Surface Colors */
  --color-surface-light: #ffffff;
  --color-surface-dark: #262626;
  --color-card-dark: #2d2d2d;

  /* Text Colors */
  --color-text-light: #2D2D2D;
  --color-text-dark: #e5e5e5;
  --color-text-muted: #6b7280;

  /* Border Colors */
  --color-border: #171212;
  --color-border-light: #e5e5e5;

  /* Accent Colors */
  --color-accent-green: #27AE60;
  --color-accent-yellow: #FEF3C7;

  /* Shadows */
  --shadow-neo: 4px 4px 0px 0px rgba(0, 0, 0, 1);
  --shadow-neo-sm: 2px 2px 0px 0px rgba(0, 0, 0, 1);
  --shadow-neo-dark: 4px 4px 0px 0px rgba(255, 255, 255, 0.1);

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;

  /* Fonts */
  --font-display: 'Playfair Display', serif;
  --font-body: 'Inter', sans-serif;
  --font-hand: 'Caveat', cursive;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-medium: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ============ Dark Mode Variables ============ */
.dark {
  --color-bg: var(--color-bg-dark);
  --color-surface: var(--color-surface-dark);
  --color-text: var(--color-text-dark);
  --shadow-neo: var(--shadow-neo-dark);
}

/* ============ Dark Mode Enhanced Contrast ============ */
.dark body {
  background-color: #121212;
  color: #f5f5f5;
}

/* Dark mode text contrast improvements */
.dark .text-gray-500 {
  color: #a3a3a3 !important;
}

.dark .text-gray-600 {
  color: #b3b3b3 !important;
}

.dark .text-gray-400 {
  color: #c4c4c4 !important;
}

.dark .text-gray-700 {
  color: #d4d4d4 !important;
}

.dark .text-gray-800 {
  color: #e5e5e5 !important;
}

/* Dark mode card backgrounds */
.dark .bg-white {
  background-color: #1e1e1e !important;
}

.dark .bg-background-light {
  background-color: #121212 !important;
}

/* Dark mode borders */
.dark .border-black {
  border-color: #404040 !important;
}

.dark .border-gray-200 {
  border-color: #3d3d3d !important;
}

/* Dark mode heading and title colors */
.dark h1,
.dark h2,
.dark h3,
.dark h4,
.dark h5,
.dark h6 {
  color: #ffffff;
}

/* Dark mode subtitle and description colors */
.dark .font-serif.italic {
  color: #c4c4c4;
}

/* Dark mode primary colors adjustment for visibility */
.dark .text-primary {
  color: #00c4be !important;
}

.dark .text-primary-teal {
  color: #00d4ce !important;
}

/* Dark mode yellow backgrounds need dark text */
.dark .bg-yellow-50,
.dark .bg-yellow-100,
.dark .bg-yellow-200 {
  background-color: #2d2d1a !important;
}

.dark .bg-yellow-50 p,
.dark .bg-yellow-100 p,
.dark .bg-yellow-200 p {
  color: #e5e5e5 !important;
}

/* Dark mode amber backgrounds */
.dark .bg-amber-200 {
  background-color: #3d3520 !important;
  color: #f5f5f5 !important;
}

/* Dark mode input fields */
.dark input,
.dark select,
.dark textarea {
  background-color: #2d2d2d;
  color: #f5f5f5;
  border-color: #404040;
}

.dark input::placeholder {
  color: #888888;
}

/* Dark mode footer text */
.dark footer .text-gray-400 {
  color: #9ca3af !important;
}

.dark footer .text-gray-500 {
  color: #9ca3af !important;
}

/* Dark mode dropdown menu */
.dark .group-hover\\:bg-gray-100:hover {
  background-color: #2d2d2d !important;
}

/* Dark mode book card quote boxes */
.dark .bg-yellow-50.dark\\:bg-gray-800 p {
  color: #e5e5e5 !important;
}

/* Dark mode breadcrumb */
.dark nav ol span.font-semibold {
  color: #ffffff;
}

/* Dark mode filter sidebar */
.dark aside .text-gray-500 {
  color: #b3b3b3 !important;
}

/* Dark mode event cards date section text improvement */
.dark .bg-black span.text-white {
  color: #ffffff !important;
}

/* Dark mode hover states */
.dark a:hover {
  color: #00d4ce;
}

/* Dark mode prose content */
.dark .prose p,
.dark .prose li {
  color: #d4d4d4;
}

.dark .prose h3 {
  color: #ffffff;
}

/* ============ Base Styles ============ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg-light);
  color: var(--color-text-light);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ============ Typography ============ */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
}

.font-display {
  font-family: var(--font-display);
}

.font-body {
  font-family: var(--font-body);
}

.font-hand {
  font-family: var(--font-hand);
}

/* ============ Links ============ */
a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary);
}

/* ============ Custom Scrollbar ============ */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-light);
}

::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: var(--radius-sm);
}

.dark ::-webkit-scrollbar-track {
  background: var(--color-bg-dark);
}

/* ============ Neo-Brutalist Components ============ */
.neo-box {
  border: 2px solid var(--color-border);
  box-shadow: var(--shadow-neo);
  background-color: var(--color-surface-light);
  transition: all var(--transition-fast);
}

.dark .neo-box {
  border-color: rgba(255, 255, 255, 0.2);
  background-color: var(--color-surface-dark);
}

.neo-box:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px 0px rgba(0, 0, 0, 1);
}

.neo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-weight: 700;
  border: 2px solid var(--color-border);
  box-shadow: var(--shadow-neo);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.neo-btn:active {
  box-shadow: none;
  transform: translate(4px, 4px);
}

.neo-btn-primary {
  background-color: var(--color-secondary);
  color: white;
}

.neo-btn-primary:hover {
  background-color: var(--color-secondary-dark);
  color: white;
}

.neo-btn-outline {
  background-color: transparent;
  color: var(--color-text-light);
}

.neo-btn-outline:hover {
  background-color: var(--color-border);
  color: white;
}

/* ============ Cards ============ */
.book-card {
  background-color: var(--color-surface-light);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-neo);
  transition: transform var(--transition-medium);
}

.dark .book-card {
  background-color: var(--color-card-dark);
  border-color: rgba(255, 255, 255, 0.2);
}

.book-card:hover {
  transform: translateY(-8px);
}

.book-card img {
  width: 100%;
  height: auto;
  object-fit: cover;
  filter: grayscale(100%);
  transition: filter var(--transition-slow);
}

.book-card:hover img {
  filter: grayscale(0%);
}

/* ============ Event Cards ============ */
.event-card {
  display: flex;
  flex-direction: column;
  background-color: var(--color-surface-light);
  border: 2px solid var(--color-border);
  box-shadow: var(--shadow-neo);
  transition: all var(--transition-medium);
}

@media (min-width: 768px) {
  .event-card {
    flex-direction: row;
  }
}

.event-card:hover {
  transform: translateY(-4px);
}

.event-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  background-color: var(--color-border);
  color: white;
}

.event-date .month {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-primary);
}

.event-date .day {
  font-size: 3rem;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1;
}

.event-date .time {
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

/* ============ Form Elements ============ */
.neo-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--color-border);
  background-color: var(--color-surface-light);
  font-family: var(--font-body);
  transition: all var(--transition-fast);
}

.neo-input:focus {
  outline: none;
  box-shadow: var(--shadow-neo-sm);
}

.dark .neo-input {
  background-color: var(--color-surface-dark);
  color: var(--color-text-dark);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ============ Tags & Badges ============ */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid currentColor;
}

.tag-primary {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.tag-secondary {
  color: var(--color-secondary);
  background-color: var(--color-secondary);
  color: white;
}

.badge-new {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  background-color: var(--color-secondary);
  color: white;
  z-index: 10;
}

/* ============ Section Styling ============ */
.section-title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.section-subtitle {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--color-text-muted);
}

/* ============ Container ============ */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .container {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 2rem;
  }
}

/* ============ Celestina Note ============ */
.celestina-note {
  position: relative;
  padding: 1.5rem;
  background-color: var(--color-accent-yellow);
  border-left: 4px solid var(--color-accent-green);
  transform: rotate(-1deg);
}

.celestina-note p {
  font-family: var(--font-hand);
  font-size: 1.25rem;
  color: var(--color-text-light);
  font-style: italic;
}

/* ============ Utility Classes ============ */
.text-primary {
  color: var(--color-primary);
}

.text-secondary {
  color: var(--color-secondary);
}

.text-muted {
  color: var(--color-text-muted);
}

.bg-primary {
  background-color: var(--color-primary);
}

.bg-secondary {
  background-color: var(--color-secondary);
}

.border-primary {
  border-color: var(--color-primary);
}

.border-secondary {
  border-color: var(--color-secondary);
}

/* ============ Animations ============ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

/* ============ Print Styles ============ */
@media print {
  .no-print {
    display: none !important;
  }
}

/* ============ Preloader ============ */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-bg-light);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.dark .preloader {
  background: var(--color-bg-dark);
}

.preloader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.preloader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeInPreloader 0.8s ease forwards;
}

.preloader-logo {
  width: 180px;
  height: auto;
  margin-bottom: 2rem;
  animation: logoFloat 2s ease-in-out infinite;
}

/* Book Animation Container */
.preloader-book {
  position: relative;
  width: 80px;
  height: 60px;
  margin-bottom: 1.5rem;
}

.preloader-book .book-inner {
  position: absolute;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  perspective: 200px;
}

/* Book Pages */
.preloader-book .page {
  position: absolute;
  width: 40px;
  height: 50px;
  background: white;
  border: 2px solid var(--color-border);
  border-radius: 0 3px 3px 0;
  transform-origin: left center;
  left: 50%;
  top: 5px;
}

.dark .preloader-book .page {
  background: #3d3d3d;
  border-color: #5d5d5d;
}

.preloader-book .page:nth-child(1) {
  animation: flipPage 1.8s ease-in-out infinite;
  animation-delay: 0s;
  z-index: 4;
}

.preloader-book .page:nth-child(2) {
  animation: flipPage 1.8s ease-in-out infinite;
  animation-delay: 0.15s;
  z-index: 3;
}

.preloader-book .page:nth-child(3) {
  animation: flipPage 1.8s ease-in-out infinite;
  animation-delay: 0.3s;
  z-index: 2;
}

/* Book Spine */
.preloader-book .spine {
  position: absolute;
  width: 10px;
  height: 56px;
  background: var(--color-primary);
  left: 50%;
  top: 2px;
  transform: translateX(-50%);
  border: 2px solid var(--color-border);
  border-radius: 2px;
  box-shadow: var(--shadow-neo-sm);
}

/* Loading Text */
.preloader-text {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text-light);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: textPulse 1.5s ease-in-out infinite;
}

.dark .preloader-text {
  color: var(--color-text-dark);
}

/* Loading Dots */
.preloader-dots {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.preloader-dots span {
  width: 10px;
  height: 10px;
  background: var(--color-primary);
  border: 2px solid var(--color-border);
  animation: dotBounce 1.4s ease-in-out infinite;
}

.preloader-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.preloader-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

/* Decorative Quote */
.preloader-quote {
  position: absolute;
  bottom: 3rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  color: var(--color-text-muted);
  text-align: center;
  padding: 0 2rem;
  max-width: 400px;
  opacity: 0;
  animation: fadeInQuote 1s ease 0.5s forwards;
}

/* Preloader Animations */
@keyframes fadeInPreloader {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes logoFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@keyframes flipPage {

  0%,
  100% {
    transform: rotateY(0deg);
  }

  50% {
    transform: rotateY(-160deg);
  }
}

@keyframes textPulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

@keyframes dotBounce {

  0%,
  80%,
  100% {
    transform: scale(1);
    opacity: 0.6;
  }

  40% {
    transform: scale(1.3);
    opacity: 1;
  }
}

@keyframes fadeInQuote {
  to {
    opacity: 1;
  }
}

/* Progress Bar Alternative */
.preloader-progress {
  width: 200px;
  height: 4px;
  background: var(--color-border-light);
  border: 1px solid var(--color-border);
  margin-top: 1.5rem;
  overflow: hidden;
}

.dark .preloader-progress {
  background: #3d3d3d;
  border-color: #5d5d5d;
}

.preloader-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  width: 0;
  animation: loadProgress 2s ease-in-out infinite;
}

@keyframes loadProgress {
  0% {
    width: 0;
    margin-left: 0;
  }

  50% {
    width: 100%;
    margin-left: 0;
  }

  100% {
    width: 0;
    margin-left: 100%;
  }
}

/* ============ Literary Quotes ============ */
.literary-quote-container {
  padding: 4rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  max-width: 1024px;
  margin: 0 auto;
}

.literary-quote {
  font-family: var(--font-hand);
  font-size: 2.25rem;
  line-height: 1.3;
  color: var(--color-primary);
  max-width: 900px;
  margin: 0 auto 1.5rem;
  position: relative;
  font-weight: 500;
}

.literary-quote::before,
.literary-quote::after {
  content: '"';
  font-family: var(--font-display);
  font-size: 6rem;
  color: var(--color-secondary);
  opacity: 0.15;
  position: absolute;
  line-height: 1;
}

.literary-quote::before {
  top: -2rem;
  left: -1rem;
}

.literary-quote::after {
  bottom: -4rem;
  right: -1rem;
}

.literary-quote-author {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-text-muted);
  position: relative;
  display: inline-block;
}

.literary-quote-author::before {
  content: '';
  display: block;
  width: 50px;
  height: 2px;
  background-color: var(--color-secondary);
  margin: 0 auto 0.75rem;
}

.dark .literary-quote {
  color: #26c6da;
}

.dark .literary-quote-author {
  color: var(--color-text-dark);
}

@media (min-width: 768px) {
  .literary-quote {
    font-size: 3rem;
  }

  .literary-quote::before {
    left: -3rem;
  }

  .literary-quote::after {
    right: -3rem;
  }
}

/* ============ Menú Emocional Destacado ============ */
.emotional-nav-btn {
  background: linear-gradient(135deg, #C0392B 0%, #E74C3C 50%, #9B59B6 100%);
  color: white;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border: 2px solid #1a1a1a;
  box-shadow: 2px 2px 0px 0px rgba(0, 0, 0, 1);
  transition: all 0.2s ease;
  font-size: 0.875rem;
}

.emotional-nav-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0px 0px rgba(0, 0, 0, 1);
  color: white;
}

.emotional-nav-dropdown {
  background: linear-gradient(135deg, #FDF2F8 0%, #F3E8FF 100%);
  border: 2px solid #9B59B6;
  border-radius: 0.5rem;
  box-shadow: 4px 4px 0px 0px rgba(0, 0, 0, 1);
}

.dark .emotional-nav-dropdown {
  background: linear-gradient(135deg, #2d1f3d 0%, #1f2937 100%);
  border-color: #C0392B;
}

.emotional-nav-item {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
}

.emotional-nav-item:hover {
  background-color: rgba(255, 255, 255, 0.5);
  color: inherit;
}

.dark .emotional-nav-item:hover {
  background-color: rgba(75, 85, 99, 0.5);
}

.emotional-nav-item .emoji {
  font-size: 1.25rem;
  margin-right: 0.5rem;
}

.emotional-nav-item .subtitle {
  display: block;
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

.dark .emotional-nav-item .subtitle {
  color: #9ca3af;
}

/* Mobile emotional nav */
.emotional-mobile-header {
  background: linear-gradient(135deg, #C0392B 0%, #9B59B6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 0;
  border-bottom: 2px dashed #9B59B6;
  margin-bottom: 0.5rem;
}

.emotional-mobile-item {
  display: flex;
  align-items: center;
  padding: 0.5rem 0;
  font-weight: 500;
}


/* ============ Scroll Reveal Animations ============ */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* Stagger delays for grid items */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }