/* Cultural Heritage Website V2 - Enhanced Styles */

:root {
  --primary-color: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary-color: #7c3aed;
  --success-color: #059669;
  --warning-color: #d97706;
  --danger-color: #dc2626;
  --dark-color: #1f2937;
  --light-color: #f8fafc;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1),
    0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1),
    0 8px 10px -6px rgb(0 0 0 / 0.1);
}

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

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  line-height: 1.6;
  color: var(--gray-800);
  overflow-x: hidden;
  padding-top: 76px; /* Add padding to account for fixed navbar */
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px; /* Account for fixed navbar when scrolling to anchors */
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@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);
  }
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

.animate-fade-up {
  animation: fadeUp 0.8s ease-out forwards;
  opacity: 0;
}

.animate-fade-in {
  animation: fadeIn 0.6s ease-out forwards;
  opacity: 0;
}

.animate-slide-left {
  animation: slideInLeft 0.8s ease-out forwards;
  opacity: 0;
}

.animate-slide-right {
  animation: slideInRight 0.8s ease-out forwards;
  opacity: 0;
}

/* Navigation Styles - FIXED Z-INDEX ISSUES */
.navbar {
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  z-index: 1050 !important; /* Ensure navbar is always on top */
  position: fixed !important;
  top: 0;
  width: 100%;
}

.navbar.scrolled {
  background-color: rgba(255, 255, 255, 0.95) !important;
  box-shadow: var(--shadow-lg);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  transition: all 0.3s ease;
}

.navbar-brand:hover {
  transform: scale(1.05);
}

.navbar-nav .nav-link {
  font-weight: 500;
  padding: 0.75rem 1rem !important;
  margin: 0 0.25rem;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
  position: relative;
}

.navbar-nav .nav-link:hover {
  background-color: rgba(37, 99, 235, 0.1);
  color: var(--primary-color) !important;
  transform: translateY(-2px);
}

.navbar-nav .nav-link.active {
  background-color: var(--primary-color);
  color: white !important;
  box-shadow: var(--shadow);
}

.dropdown-menu {
  border: none;
  box-shadow: var(--shadow-xl);
  border-radius: 0.75rem;
  padding: 0.5rem;
  z-index: 1060; /* Higher than navbar */
}

.dropdown-item {
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
}

.dropdown-item:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateX(5px);
}

/* Hero Section */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  z-index: 1; /* Below navbar */
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=1920&h=1080&fit=crop")
    center / cover;
  opacity: 0.1;
  z-index: 1;
}

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

.hero-scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 1.5rem;
  animation: bounce 2s infinite;
  cursor: pointer;
  z-index: 2;
}

/* Main Content Sections - FIXED Z-INDEX */
main {
  position: relative;
  z-index: 1; /* Below navbar */
}

section {
  position: relative;
  z-index: 1; /* Below navbar */
}

/* Stats Section */
.stat-item {
  padding: 1rem;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.stat-item:hover {
  transform: translateY(-5px);
}

.counter {
  font-weight: 700;
  color: white;
}

/* Cards */
.hover-card {
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border-radius: 1rem;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.hover-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: var(--shadow-xl);
  z-index: 2; /* Slightly higher when hovered, but still below navbar */
}

.news-card {
  transition: all 0.3s ease;
  border-radius: 1rem;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.news-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  z-index: 2;
}

.news-card img {
  transition: all 0.3s ease;
}

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

/* Icon Containers */
.icon-container {
  width: 80px;
  height: 80px;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.icon-container.primary {
  background: linear-gradient(
    135deg,
    rgba(37, 99, 235, 0.1) 0%,
    rgba(37, 99, 235, 0.2) 100%
  );
  color: var(--primary-color);
}

.icon-container.success {
  background: linear-gradient(
    135deg,
    rgba(5, 150, 105, 0.1) 0%,
    rgba(5, 150, 105, 0.2) 100%
  );
  color: var(--success-color);
}

.icon-container.warning {
  background: linear-gradient(
    135deg,
    rgba(217, 119, 6, 0.1) 0%,
    rgba(217, 119, 6, 0.2) 100%
  );
  color: var(--warning-color);
}

.icon-container.danger {
  background: linear-gradient(
    135deg,
    rgba(220, 38, 38, 0.1) 0%,
    rgba(220, 38, 38, 0.2) 100%
  );
  color: var(--danger-color);
}

.hover-card:hover .icon-container {
  transform: scale(1.1) rotate(5deg);
}

/* Buttons */
.btn {
  font-weight: 500;
  border-radius: 0.75rem;
  padding: 0.75rem 1.5rem;
  transition: all 0.3s ease;
  border: none;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-dark) 100%
  );
}

.btn-floating {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1040; /* Below navbar but above content */
  box-shadow: var(--shadow-lg);
}

/* Timeline Styles */
.timeline {
  position: relative;
  padding: 2rem 0;
  z-index: 1;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gray-300);
  transform: translateX(-50%);
  z-index: 1;
}

.timeline-item {
  position: relative;
  margin-bottom: 3rem;
  width: 50%;
  z-index: 2;
}

.timeline-item:nth-child(odd) {
  left: 0;
  padding-right: 2rem;
}

.timeline-item:nth-child(even) {
  left: 50%;
  padding-left: 2rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--primary-color);
  border-radius: 50%;
  top: 1rem;
  z-index: 3;
}

.timeline-item:nth-child(odd)::before {
  right: -10px;
}

.timeline-item:nth-child(even)::before {
  left: -10px;
}

.timeline-content {
  background: white;
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
}

.timeline-content:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

/* Badge Styles */
.badge {
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  position: relative;
  z-index: 1;
}

/* Form Styles */
.form-control,
.form-select {
  border-radius: 0.75rem;
  border: 2px solid var(--gray-200);
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
  z-index: 2;
}

/* Loading Spinner */
.spinner-border {
  width: 3rem;
  height: 3rem;
}

/* Social Links */
.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.social-links a:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
}

/* Modal and Overlay Z-Index */
.modal {
  z-index: 1055 !important; /* Above navbar */
}

.modal-backdrop {
  z-index: 1054 !important; /* Above navbar but below modal */
}

.modal-title{
  color: black;

}
.text-muted{
  color: rgb(1, 1, 1);

}
.form-label{
  color: black;
}
.form-check-label{
  color: black;
}
.fw-bold{
  color: #000;

}
.offcanvas {
  z-index: 1055 !important;
}

.offcanvas-backdrop {
  z-index: 1054 !important;
}

/* Toast notifications */
.toast-container {
  z-index: 1060 !important;
}

/* Popover and Tooltip */
.popover {
  z-index: 1070 !important;
}

.tooltip {
  z-index: 1080 !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  body {
    padding-top: 60px; /* Smaller padding for mobile navbar */
  }

  html {
    scroll-padding-top: 80px; /* Adjust for mobile navbar */
  }

  .display-2 {
    font-size: 2.5rem;
  }

  .display-3 {
    font-size: 2rem;
  }

  .display-4 {
    font-size: 1.75rem;
  }

  .display-5 {
    font-size: 1.5rem;
  }

  .display-6 {
    font-size: 1.25rem;
  }

  .lead {
    font-size: 1.1rem;
  }

  .hero-section {
    min-height: 80vh;
    padding: 2rem 0;
  }

  .timeline::before {
    left: 1rem;
  }

  .timeline-item {
    width: 100%;
    left: 0 !important;
    padding-left: 3rem !important;
    padding-right: 0 !important;
  }

  .timeline-item::before {
    left: 0.5rem !important;
  }

  .btn-floating {
    bottom: 1rem;
    right: 1rem;
    width: 45px;
    height: 45px;
  }
}

@media (max-width: 576px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .hero-section .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .btn-lg {
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
  }
}

/* Print Styles */
@media print {
  .navbar,
  .btn-floating,
  .hero-scroll-indicator {
    display: none !important;
  }

  .hero-section {
    min-height: auto;
    padding: 2rem 0;
  }

  body {
    font-size: 12pt;
    line-height: 1.4;
    padding-top: 0;
  }

  .card {
    break-inside: avoid;
    margin-bottom: 1rem;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --gray-800: #f9fafb;
    --gray-600: #d1d5db;
    --light-color: #1f2937;
  }

  body.dark-theme {
    background-color: #111827;
    color: #f9fafb;
  }

  .dark-theme .navbar {
    background-color: rgba(17, 24, 39, 0.95) !important;
  }

  .dark-theme .card {
    background-color: #1f2937;
    border-color: #374151;
  }

  .dark-theme .bg-light {
    background-color: #1f2937 !important;
  }
}

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

/* Focus Styles */
.btn:focus,
.nav-link:focus,
.form-control:focus,
.form-select:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
