@import './colors.css';

/* Reset and base styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

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

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

a {
  color: var(--accent-gold);
  text-decoration: none;
  transition: color 0.2s ease;
}

.news-card ul {
  padding-left: 2rem; /* Ajusta según lo que necesites */
  margin: 0; /* Opcional, para evitar márgenes extra */
}

a:hover {
  color: var(--accent-amber);
  text-decoration: underline;
}

/* Layout Components */
.site-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.site-header {
  background: linear-gradient(135deg, var(--primary-forest) 0%, var(--primary-moss) 100%);
  border-bottom: 2px solid var(--border-strong);
  box-shadow: var(--shadow-medium);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: transform 0.25s ease;
}

.site-header.hide-on-scroll {
  transform: translateY(-100%);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 2px solid var(--accent-bronze);
}

.site-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-accent);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.site-tagline {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* Language Toggle */
.language-toggle {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.lang-btn {
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.lang-btn:hover, .lang-btn.active {
  background: var(--accent-bronze);
  color: var(--text-primary);
  border-color: var(--accent-gold);
}

/* Navigation - Modern Overlay Design */
.main-navigation {
  position: sticky;
  top: 0; /* siempre visible pegado arriba */
  background: var(--bg-dark);
  border: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  z-index: 200;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
}

.nav-toggle {
  display: none;
  background: linear-gradient(135deg, var(--primary-forest), var(--primary-moss));
  border: 2px solid var(--accent-bronze);
  color: var(--text-accent);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-small);
  position: relative;
  overflow: hidden;
}

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

.nav-toggle:hover::before {
  left: 100%;
}

.nav-toggle:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
  border-color: var(--accent-gold);
}

.nav-toggle.active {
  background: linear-gradient(135deg, var(--accent-bronze), var(--accent-gold));
  color: var(--bg-dark);
}

/* Main Navigation Bar */
.nav-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem 0;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nav-item {
  position: relative;
  display: inline-block;
}

.nav-trigger {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-light));
  border: 1px solid var(--border-subtle);
  color: var(--text-accent);
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 140px;
  justify-content: space-between;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.nav-trigger::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-amber), var(--accent-gold));
  transform: scaleX(0);
  transition: transform 0.3s ease;
  transform-origin: left;
}

.nav-trigger:hover::before,
.nav-item.active .nav-trigger::before {
  transform: scaleX(1);
}

.nav-trigger:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
  border-color: var(--border-medium);
  background: linear-gradient(135deg, var(--bg-light), var(--bg-card));
}

.nav-trigger::after {
  content: '▼';
  font-size: 0.7rem;
  opacity: 0.7;
  transition: transform 0.3s ease;
}

.nav-item.active .nav-trigger::after {
  transform: rotate(180deg);
}

/* Dropdown Menu */
.nav-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  padding: 1rem;
  min-width: 280px;
  max-width: 400px;
  box-shadow: var(--shadow-large);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(20px);
  z-index: 1000;
  max-height: 80vh;
  overflow-y: auto;
}

.nav-dropdown::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-bottom: none;
  border-right: none;
  transform: translateX(-50%) rotate(45deg);
}

.nav-item.active .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Dropdown Content */
.nav-dropdown h3 {
  color: var(--text-accent);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-gold);
  text-align: center;
}

.nav-dropdown ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-dropdown li {
  margin: 0;
}

.nav-dropdown a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  border-left: 3px solid transparent;
  position: relative;
}

.nav-dropdown a:hover {
  background: var(--hover-overlay);
  color: var(--text-primary);
  border-left-color: var(--accent-gold);
  transform: translateX(4px);
  text-decoration: none;
}

.nav-dropdown a::before {
  content: '→';
  position: absolute;
  right: 1rem;
  opacity: 0;
  transition: opacity 0.2s ease;
  color: var(--accent-gold);
}

.nav-dropdown a:hover::before {
  opacity: 1;
}

/* Mobile Navigation */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
    margin: 0 auto;
  }
  
  .nav-bar {
    display: none;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-medium);
    border-radius: 12px;
    margin-top: 1rem;
    box-shadow: var(--shadow-large);

    position: relative;
    z-index: 300;
    max-height: calc(100vh - var(--header-height, 72px) - 2rem);
    overflow-y: auto;
  }
  
  .nav-bar.active {
    display: flex;
    animation: slideDown 0.3s ease;
  }
  
  .nav-item {
    width: 100%;
  }
  
  .nav-trigger {
    width: 100%;
    justify-content: space-between;
  }
  
  .nav-dropdown {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    margin-top: 0.5rem;
    box-shadow: inset 0 2px 4px var(--bg-dark);
    background: var(--bg-dark);
    max-height: none;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    word-break: break-word;
    box-sizing: border-box;
  }
  
  .nav-dropdown::before {
    display: none;
  }
  
  .nav-item:not(.active) .nav-dropdown {
    display: none;
  }
}

/* Overlay for mobile menu */
.nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 150;
  backdrop-filter: blur(4px);
}

.nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

@media (min-width: 769px) {
  .nav-overlay {
    display: none;
  }
}

/* Scrollbar for dropdown */
.nav-dropdown::-webkit-scrollbar {
  width: 4px;
}

.nav-dropdown::-webkit-scrollbar-track {
  background: var(--bg-medium);
  border-radius: 2px;
}

.nav-dropdown::-webkit-scrollbar-thumb {
  background: var(--accent-gold);
  border-radius: 2px;
}

.nav-dropdown::-webkit-scrollbar-thumb:hover {
  background: var(--accent-amber);
}

/* Main Content */
.main-content {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
}

.hero-section {
  text-align: center;
  padding: 4rem 0;
  background: linear-gradient(135deg, var(--bg-medium) 0%, var(--bg-card) 100%);
  border-radius: 16px;
  margin-bottom: 3rem;
  border: 1px solid var(--border-subtle);
}

.hero-title {
  font-size: 3rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--text-accent), var(--accent-amber));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-description {
  font-size: 1.1rem;
  color: var(--text-tertiary);
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.8;
}

/* Footer */
.site-footer {
  background: var(--primary-forest);
  border-top: 2px solid var(--border-strong);
  margin-top: auto;
  padding: 2rem 0 1rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3 {
  color: var(--text-accent);
  font-size: 1.1rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.footer-section ul {
  list-style: none;
}

.footer-section li {
  margin: 0.5rem 0;
}

.footer-section a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.footer-section a:hover {
  color: var(--text-accent);
}

.footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-tertiary);
  font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 1rem;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .nav-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .menu-col ul {
    display: none !important;
  }
  
  .menu-col.open ul {
    display: block !important;
  }
  
  .main-content {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .hero-section {
    padding: 2rem 1rem;
  }
  
  .menu-col {
    padding: 1rem;
  }
}

/* Animations */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Focus and accessibility */
.lang-btn:focus,
.menu-col h2:focus,
.menu-col a:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Hidden class for language switching */
/* Language visibility rules (exclude language toggle buttons) */
[data-lang]:not([data-lang="es"]):not(.lang-btn) {
  display: none;
}

body.lang-en [data-lang]:not([data-lang="en"]):not(.lang-btn) {
  display: none;
}

body.lang-en [data-lang="en"]:not(.lang-btn) {
  display: initial;
}

/* Additional Homepage Styles */

/* Section Titles */
.section-title {
  font-size: 2rem;
  text-align: center;
  margin: 3rem 0 2rem 0;
  color: var(--text-accent);
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-amber), var(--accent-gold));
  margin: 1rem auto;
  border-radius: 2px;
}

/* Features Section */
.features-section {
  margin: 4rem 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.feature-card {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  transition: all 0.3s ease;
  text-align: center;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-large);
  border-color: var(--border-medium);
}

.feature-card h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--text-accent);
}

.feature-card p {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Quick Access Section */
.quick-access-section {
  margin: 4rem 0;
}

.quick-access-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.access-card {
  display: block;
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  text-decoration: none;
  transition: all 0.3s ease;
  border-left: 4px solid transparent;
}

.access-card:hover {
  transform: translateX(4px);
  border-left-color: var(--accent-gold);
  background: var(--hover-overlay);
  text-decoration: none;
}

.access-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text-accent);
}

.access-card p {
  color: var(--text-tertiary);
  font-size: 0.9rem;
  margin: 0;
}

/* News Section */
.news-section {
  margin: 4rem 0;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.news-card {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  transition: all 0.3s ease;
}

.news-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
  border-color: var(--border-medium);
}

.news-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text-accent);
  line-height: 1.3;
}

.news-date {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  margin-bottom: 1rem;
  font-style: italic;
}

.news-card p:not(.news-date) {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}

.news-actions {
  text-align: center;
  margin-top: 2rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-amber), var(--accent-gold));
  color: var(--bg-dark);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-amber));
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
  text-decoration: none;
}

/* Mobile Responsive for New Sections */
@media (max-width: 768px) {
  .section-title {
    font-size: 1.5rem;
  }
  
  .features-grid,
  .quick-access-grid,
  .news-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .feature-card,
  .news-card {
    padding: 1.25rem;
  }
  
  .access-card {
    padding: 1.25rem;
  }
}
