/* Base Styles & Design System: Cielo Alto */
:root {
  --sun-gold: #FBC02D;
  --sun-amber: #FFA000;
  --sun-light: #FFECB3;
  --sky-blue: #0288D1;
  --sky-pale: #E1F5FE;
  --mtn-brown: #5D4037;
  --mtn-clay: #8D6E63;
  --mtn-earth: #D7CCC8;
  --text-dark: #212121;
  --text-light: #F5F5F5;
  --glass: rgba(255, 255, 255, 0.15);
  --glass-border: rgba(255, 255, 255, 0.2);
  --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

/* Splash Screen (Loading) */
#loading-screen {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100vh;
  background: white;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.8s ease, visibility 0.8s;
  display: none; /* Hidden by default, JS will show if needed */
}

#loading-screen.active {
  display: flex;
}

#loading-screen img {
  width: 200px;
  height: auto;
  animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', 'Inter', sans-serif;
}

body {
  background-color: var(--sky-pale);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Header & Nav Base */
header {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid var(--glass-border);
}

header.scrolled {
  background: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.logo {
  font-weight: 800;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 50px;
}

@media (min-width: 1024px) {
  .logo { height: 75px; }
}

.logo img {
  height: 100%;
  width: auto;
  object-fit: contain;
  transition: opacity 0.3s ease;
}

.logo .logo-black { display: none; }
.logo .logo-white { display: block; }

header.scrolled .logo .logo-black { display: block; }
header.scrolled .logo .logo-white { display: none; }

.nav-toggle {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 1001;
}

.bar {
  width: 28px;
  height: 3px;
  background-color: var(--sky-blue);
  border-radius: 2px;
  transition: 0.3s;
}

/* Mobile Nav Menu */
.nav-menu {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 70%;
  background: var(--sky-blue);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  transform: translateX(100%);
  transition: transform 0.4s ease-in-out;
  list-style: none;
  z-index: 999;
}

.nav-menu.active { transform: translateX(0); }

.nav-link {
  color: white;
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: all 0.3s ease;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.nav-link:hover, .nav-link.active { color: var(--sun-gold); }

header.scrolled .nav-link {
  color: var(--sky-blue);
  text-shadow: none;
}

header.scrolled .nav-link:hover, header.scrolled .nav-link.active {
  color: var(--sun-amber);
}

/* Hero Section */
.hero {
  height: 100vh;
  background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)), url('hero-bg.png');
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 2rem;
  color: white;
}

.hero h1, .tourism-hero h1, .culture-hero h1, .deporte-hero h1 {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 900;
  color: #FFFFFF !important;
  text-shadow: 0 4px 15px rgba(0,0,0,0.6);
  margin-bottom: 1rem;
  line-height: 1.1;
  text-transform: uppercase;
}

.hero p, .tourism-hero p, .culture-hero p, .deporte-hero p {
  font-size: clamp(0.8rem, 2vw, 1.1rem);
  text-transform: uppercase;
  letter-spacing: 5px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(5px);
  padding: 0.5rem 1.5rem;
  color: #FFFFFF !important;
  font-weight: 800;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  margin-bottom: 1rem;
}

/* Modern Back Button */
.back-btn {
  position: absolute;
  top: 120px; left: 5%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  color: white;
  text-decoration: none;
  padding: 0.8rem 1.5rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
  z-index: 100;
}

.back-btn:hover {
  background: white;
  color: var(--sky-blue);
  transform: translateX(-5px);
}

@media (max-width: 768px) {
  .back-btn { top: 100px; padding: 0.6rem 1.2rem; font-size: 0.8rem; }
}

/* Dashboard Portal */
.dashboard-container {
  max-width: 1200px;
  margin: -50px auto 4rem;
  background: white;
  padding: 2rem;
  border-radius: 30px;
  box-shadow: var(--shadow);
  position: relative;
  z-index: 10;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.dashboard-card {
  text-decoration: none;
  background: var(--sky-pale);
  padding: 2rem;
  border-radius: 20px;
  text-align: center;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.dashboard-card:hover { transform: translateY(-10px); background: white; box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
.dashboard-card i { font-size: 3rem; color: var(--sky-blue); }
.dashboard-card h3 { color: var(--mtn-brown); font-size: 1.2rem; font-weight: 800; }

/* Content Layout */
.container { max-width: 1400px; margin: 0 auto; padding: 2rem; }

/* Autoridades */
.profile-card { 
  background: white; 
  border-radius: 24px; 
  box-shadow: var(--shadow); 
  overflow: hidden; 
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  position: relative;
}

.profile-card:hover {
  transform: translateY(-15px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.profile-card:hover .profile-img-placeholder i {
  color: var(--sun-amber);
  transform: scale(1.2);
}

.profile-img-placeholder {
  height: 350px;
  background: var(--sky-pale);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.profile-img-placeholder i {
  font-size: 6rem;
  color: var(--sky-blue);
  transition: all 0.4s ease;
}

.profile-info {
  padding: 2rem;
  text-align: center;
  background: white;
}

/* Modals */
#authority-modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

#authority-modal.active { display: flex; }

.modal-content {
  background: white;
  max-width: 900px;
  width: 100%;
  border-radius: 30px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  position: relative;
  animation: modalEnter 0.5s ease;
}

@keyframes modalEnter {
  from { opacity: 0; transform: translateY(50px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-img { background: var(--sky-pale); display: flex; align-items: center; justify-content: center; }
.modal-img i { font-size: 10rem; color: var(--sky-blue); }

.modal-body { padding: 3rem; position: relative; }
.modal-close {
  position: absolute;
  top: 1.5rem; right: 1.5rem;
  font-size: 2rem;
  cursor: pointer;
  color: var(--mtn-brown);
}

/* Footer */
footer { background: var(--mtn-brown); color: white; padding: 4rem 2rem; text-align: center; margin-top: 4rem; }

/* --- Media Queries --- */

@media (max-width: 768px) {
  .hero h1 { font-size: 2.5rem; }
  .dashboard-container { margin-top: 2rem; border-radius: 0; }
}

/* PC & Large Screen Optimization: MUST BE AT THE BOTTOM */
@media (min-width: 1024px) {
  header { padding: 1rem 10%; }
  
  /* Show Menu on PC */
  .nav-menu {
    position: static;
    flex-direction: row;
    height: auto;
    width: auto;
    background: none;
    transform: none;
    padding: 0;
    gap: 2.5rem;
    display: flex !important;
  }
  
  .nav-link { color: white; font-size: 0.95rem; letter-spacing: 1px; }
  .nav-link:hover, .nav-link.active { color: var(--sun-amber); }
  .nav-link.active { border-bottom: 2px solid var(--sun-amber); }
  
  header.scrolled .nav-link { color: var(--sky-blue); }
  header.scrolled .nav-link:hover, header.scrolled .nav-link.active { color: var(--sun-gold); }
  
  /* Hide Toggle on PC */
  .nav-toggle { display: none; }

  /* Desktop Grids */
  .profiles-grid { grid-template-columns: repeat(3, 1fr); gap: 3rem; }
  .dashboard-grid { grid-template-columns: repeat(4, 1fr); gap: 2rem; }
  .news-grid { grid-template-columns: repeat(2, 1fr); gap: 3rem; }

  /* High-End Visuals: Parallax & Adaptive Heights */
  .hero, .tourism-hero, .culture-hero {
    background-attachment: fixed;
    background-position: center 20%;
    height: 80vh;
  }
  .deporte-hero {
    background-attachment: fixed;
    background-position: center 65%; /* Adjusted to see the cyclist better */
    height: 80vh;
  }
  .hero { height: 100vh; }

  /* Spacing */
  .container { padding: 5rem 10%; }
  .section-title { font-size: 3rem; padding-bottom: 4rem; }
}

/* Common Styles (Post-fixes) */
/* Common Hero Layout for all pages */
.hero, .tourism-hero, .culture-hero, .deporte-hero {
  height: 100vh !important;
  background-size: cover;
  background-position: center !important;
  position: relative;
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 10%;
}

.hero::after, .tourism-hero::after, .culture-hero::after, .deporte-hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 40%;
  background: linear-gradient(to bottom, transparent, var(--sky-pale));
  pointer-events: none;
}

.tourism-hero { background-image: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)), url('parque-bg.png') !important; }
.culture-hero { background-image: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)), url('canal-bg.png') !important; }
.deporte-hero { background-image: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)), url('deporte-bg.png') !important; }

@media (max-width: 768px) {
  .modal-content { grid-template-columns: 1fr; }
  .modal-img { height: 300px; }
}

/* Provider Directory Styles */
.provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2.5rem;
  margin-top: 4rem;
}

.provider-card {
  background: white;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.4s ease;
  border: 1px solid var(--sky-pale);
  display: flex;
  flex-direction: column;
}

.provider-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 20px 40px rgba(2, 136, 209, 0.15);
}

.provider-image {
  height: 220px;
  background: var(--sky-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 5rem;
  position: relative;
}

.provider-image i { opacity: 0.8; }

.provider-badge {
  position: absolute;
  top: 1rem; right: 1rem;
  background: var(--sun-gold);
  color: var(--mtn-brown);
  padding: 0.4rem 1rem;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.provider-details {
  padding: 2rem;
  flex-grow: 1;
}

.provider-details h3 {
  font-size: 1.5rem;
  color: var(--sky-blue);
  margin-bottom: 0.5rem;
  font-weight: 900;
}

.provider-details p {
  color: var(--mtn-brown);
  font-weight: 600;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  opacity: 0.8;
}

.contact-list {
  list-style: none;
  font-size: 0.9rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1rem;
  color: #555;
}

.contact-item i {
  color: var(--sky-blue);
  font-size: 1.2rem;
}

.map-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--sky-pale);
  color: var(--sky-blue);
  text-decoration: none;
  padding: 0.8rem 1.5rem;
  border-radius: 12px;
  font-weight: 700;
  margin-top: 1rem;
  transition: all 0.3s ease;
  width: 100%;
  justify-content: center;
}

.map-btn:hover {
  background: var(--sky-blue);
  color: white;
}

/* Scroll Reveal Animations */
.reveal-init {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.stat-item.reveal-init { transform: scale(0.8); opacity: 0; }
.stat-item.revealed { transform: scale(1); opacity: 1; }
