/* ==================== THEME VARIABLES ==================== */
:root {
  /* Light Mode Colors */
  --primary-color: #4A2C2A;
  --secondary-color: #3E5062;
  --accent-color: #B8860B;
  --background-light: #FDFBF7;
  --background-secondary: #F5EFE7;
  --text-on-light: #212529;
  --text-muted: #6C757D;
  --border-color: #E8DDD0;
  --card-shadow: 0 2px 8px rgba(74, 44, 42, 0.08);
  --card-shadow-hover: 0 12px 24px rgba(74, 44, 42, 0.15);

  /* Dark Mode Colors (will be overridden) */
  --bg-dark: #FDFBF7;
  --text-dark: #212529;
  --card-dark: #FFF9F3;
  --shadow-dark: rgba(0, 0, 0, 0.1);

  /* Typography */
  --font-serif: 'Lora', serif;
  --font-sans: 'Lato', sans-serif;

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-2xl: 4rem;

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

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== DARK MODE ==================== */
body.dark-mode {
  --bg-dark: #1A1612;
  --text-dark: #F5F1ED;
  --card-dark: #2D2520;
  --shadow-dark: rgba(0, 0, 0, 0.3);
  --primary-color: #E8D5B7;
  --secondary-color: #B8D4E8;
  --accent-color: #FFD700;
  --background-light: #1A1612;
  --background-secondary: #2D2520;
  --text-on-light: #F5F1ED;
  --text-muted: #B0A195;
  --border-color: #3D3530;
  --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  --card-shadow-hover: 0 12px 24px rgba(0, 0, 0, 0.5);
}

/* ==================== BASE STYLES ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--background-light);
  color: var(--text-on-light);
  transition: background-color var(--transition-base), color var(--transition-base);
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6, .navbar-brand {
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: -0.5px;
}

a {
  transition: color var(--transition-fast);
}

/* ==================== HEADER & NAVIGATION ==================== */
header {
  background-color: var(--background-light) !important;
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
}

.navbar {
  background-color: var(--background-light) !important;
  padding: 1rem 0;
}

.navbar-brand {
  color: var(--primary-color) !important;
  font-weight: bold;
  font-size: 1.5rem;
  letter-spacing: 1px;
}

.nav-link {
  color: var(--text-on-light) !important;
  font-weight: 500;
  transition: color var(--transition-fast);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent-color);
  transition: width var(--transition-fast);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color) !important;
}

/* ==================== THEME SWITCHER ==================== */
.theme-switcher {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--background-secondary);
  border-radius: var(--radius-md);
  padding: 0.25rem;
  cursor: pointer;
  border: 1px solid var(--border-color);
}

.theme-switcher button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
  color: var(--text-on-light);
}

.theme-switcher button.active {
  background-color: var(--primary-color);
  color: var(--accent-color);
}

/* ==================== LANGUAGE SWITCHER ==================== */
.language-switcher {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--background-secondary);
  border-radius: var(--radius-md);
  padding: 0.25rem;
  cursor: pointer;
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
  font-weight: 600;
}

.language-switcher button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
  color: var(--text-on-light);
}

.language-switcher button.active {
  background-color: var(--primary-color);
  color: white;
}

/* ==================== BUTTONS ==================== */
.btn-primary-custom {
  background: linear-gradient(135deg, var(--primary-color), #5a3c3a);
  border: 1px solid var(--primary-color);
  color: white;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.btn-primary-custom::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  transition: left var(--transition-base);
  border-radius: var(--radius-md);
}

.btn-primary-custom:hover::before {
  left: 100%;
}

.btn-primary-custom:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(74, 44, 42, 0.2);
  background: linear-gradient(135deg, #5a3c3a, #4a2c2a);
}

.btn-secondary-custom {
  background: linear-gradient(135deg, var(--secondary-color), #4d5f77);
  border: 1px solid var(--secondary-color);
  color: white;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.btn-secondary-custom::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  transition: left var(--transition-base);
  border-radius: var(--radius-md);
}

.btn-secondary-custom:hover::before {
  left: 100%;
}

.btn-secondary-custom:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(62, 80, 98, 0.2);
  background: linear-gradient(135deg, #4d5f77, #3e5062);
}

.btn-outline-accent {
  border: 2px solid var(--accent-color);
  color: var(--accent-color);
  background: transparent;
  font-weight: 600;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.btn-outline-accent:hover {
  background: var(--accent-color);
  color: var(--primary-color);
}

/* ==================== BENTO GRID ==================== */
.bento-grid {
  display: grid;
  gap: var(--spacing-lg);
  margin: var(--spacing-xl) 0;
}

.bento-item {
  background: var(--background-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  transition: all var(--transition-base);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.bento-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(184, 134, 11, 0.05), transparent);
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

.bento-item:hover::before {
  opacity: 1;
}

.bento-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--accent-color);
}

/* Bento Grid Layout Variations */
@media (min-width: 768px) {
  .bento-grid {
    grid-template-columns: repeat(12, 1fr);
    gap: var(--spacing-lg);
  }

  .bento-item {
    grid-column: span 6;
    min-height: 300px;
  }

  .bento-item.large {
    grid-column: span 8;
    min-height: 400px;
  }

  .bento-item.small {
    grid-column: span 4;
    min-height: 250px;
  }

  .bento-item.tall {
    grid-column: span 6;
    grid-row: span 2;
  }

  .bento-item.wide {
    grid-column: span 12;
    min-height: 280px;
  }

  /* Specific layout patterns */
  .bento-grid.pattern-1 > .bento-item:nth-child(1) { grid-column: span 6; }
  .bento-grid.pattern-1 > .bento-item:nth-child(2) { grid-column: span 6; }
  .bento-grid.pattern-1 > .bento-item:nth-child(3) { grid-column: span 4; }
  .bento-grid.pattern-1 > .bento-item:nth-child(4) { grid-column: span 4; }
  .bento-grid.pattern-1 > .bento-item:nth-child(5) { grid-column: span 4; }

  .bento-grid.pattern-2 > .bento-item:nth-child(1) { grid-column: span 7; }
  .bento-grid.pattern-2 > .bento-item:nth-child(2) { grid-column: span 5; }
  .bento-grid.pattern-2 > .bento-item:nth-child(3) { grid-column: span 5; }
  .bento-grid.pattern-2 > .bento-item:nth-child(4) { grid-column: span 7; }
}

/* ==================== CARDS ==================== */
.card-premium {
  background: var(--background-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  transition: all var(--transition-base);
  overflow: hidden;
}

.card-premium:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-4px);
  border-color: var(--accent-color);
}

.card-premium img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.card-premium:hover img {
  transform: scale(1.05);
}

.card-body {
  padding: var(--spacing-lg);
}

/* ==================== TYPOGRAPHY ==================== */
.display-accent {
  color: var(--accent-color);
}

.text-primary-custom {
  color: var(--primary-color);
}

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

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

.lead {
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.7;
}

.subtitle {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--secondary-color);
  margin-bottom: var(--spacing-md);
}

/* ==================== SECTION STYLES ==================== */
section {
  padding: var(--spacing-2xl) 0;
}

section.hero-section {
  padding: 6rem 0;
  background-size: cover;
  background-position: center;
  position: relative;
}

section.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(74, 44, 42, 0.5);
  z-index: 1;
}

section.hero-section .container {
  position: relative;
  z-index: 2;
}

section.hero-section h1,
section.hero-section p {
  color: white;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
}

/* ==================== FOOTER ==================== */
footer {
  background-color: var(--primary-color);
  color: var(--background-light);
  padding: var(--spacing-2xl) 0 var(--spacing-lg);
  margin-top: var(--spacing-2xl);
}

footer a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}

footer a:hover {
  color: var(--background-light);
  text-decoration: underline;
}

footer h5 {
  color: var(--accent-color);
  margin-bottom: var(--spacing-md);
}

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

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-fade-in-up {
  animation: fadeInUp var(--transition-slow) ease-out forwards;
}

.animate-slide-in-left {
  animation: slideInLeft var(--transition-slow) ease-out forwards;
}

.animate-slide-in-right {
  animation: slideInRight var(--transition-slow) ease-out forwards;
}

/* Stagger animation with CSS variable */
.stagger-item {
  animation: fadeInUp var(--transition-slow) ease-out forwards;
  opacity: 0;
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(6) { animation-delay: 0.6s; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  body {
    font-size: 15px;
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }

  section {
    padding: var(--spacing-xl) 0;
  }

  .bento-grid {
    gap: var(--spacing-md);
  }

  .bento-item {
    grid-column: span 12 !important;
    min-height: auto;
    padding: var(--spacing-md);
  }

  .navbar {
    padding: 0.75rem 0;
  }

  .lead {
    font-size: 1.1rem;
  }
}

@media (max-width: 576px) {
  :root {
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
  }

  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.35rem; }
  h3 { font-size: 1.1rem; }

  section {
    padding: var(--spacing-lg) 0;
  }

  .subtitle {
    font-size: 1.15rem;
  }
}

/* ==================== ACCESSIBILITY ==================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

button:focus,
a:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* ==================== UTILITY CLASSES ==================== */
.shadow-sm-custom {
  box-shadow: var(--card-shadow);
}

.shadow-lg-custom {
  box-shadow: var(--card-shadow-hover);
}

.border-accent {
  border: 2px solid var(--accent-color) !important;
}

.bg-gradient {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
}

.text-center-custom {
  text-align: center;
}
