/**
 * Avanza 2 Casilleros Custom Styles
 * Main stylesheet with shared/global styles
 * Section-specific styles are imported from the sections/ directory
 */

/* Import Section-Specific Styles */
@import url("sections/hero-section.css");
@import url("sections/purpose-section.css");
@import url("sections/collective-games-section.css");
@import url("sections/image-carousel-section.css");
@import url("sections/proposal-section.css");
@import url("sections/games-carousel-section.css");
@import url("sections/why-games-section.css");
@import url("sections/partners-section.css");
@import url("sections/games-gallery-section.css");
@import url("sections/team-section.css");
@import url("sections/contact-section.css");

/* Official Brand Colors */
:root {
  --avanza-pink: #ec2c66;
  --avanza-yellow: #fdbd23;
  --avanza-teal: #09b5be;
  --avanza-blue: #1685b2;
  --avanza-green: #47ba95;
  --avanza-white: #ffffff;
  --avanza-black: #000000;
  --avanza-gray: #666666;
}

/* Boogaloo font for all titles */
h1,
h2,
h3,
h4,
h5,
h6,
.site-title,
.hero-title,
.section-title,
.card-title,
.member-name,
.widget-title,
.footer-widget-title,
.wp-block-heading,
.entry-title,
.page-title {
  font-family: "Boogaloo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Header Styles */
.avanza-header {
  background-color: var(--avanza-white);
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.avanza-logo {
  margin: 0;
}

.avanza-logo a {
  text-decoration: none;
  display: block;
  margin: auto;
}

.avanza-logo-img {
  height: 100px;
  width: auto;
  max-width: 462px;
  margin: auto;
  display: block;
  transition: all 0.3s ease;
}

/* Pinned header styles */
.avanza-header.pinned {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  background-color: var(--avanza-white);
  z-index: 99999;
}

.avanza-header.pinned .nav-bar {
  height: 25px;
}

/* Logo shrinking when pinned */
.avanza-header.pinned .avanza-logo-img {
  height: 50px;
  width: auto;
}

/* Add top padding to body when header is pinned */
body.header-pinned {
  padding-top: 80px; /* Adjust based on your pinned header height */
}

.nav-bar {
  display: flex;
  height: 50px;
  width: 100%;
}

.nav-segment {
  flex: 1;
}

.avanza-nav {
  display: flex;
  gap: 30px;
  align-items: center;
  justify-content: space-around;
  width: 100%;
}

.avanza-nav a {
  color: var(--avanza-black);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.avanza-nav a:hover {
  color: var(--avanza-pink);
}

/* Desktop Navigation Styles */
.main-navigation {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  padding: 0 20px;
  position: relative;
}

.main-navigation ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 30px;
}

.main-navigation li {
  margin: 0;
}

.main-navigation a {
  /* Color is set by customizer - don't override here */
  text-decoration: none;
  font-weight: 500;
  font-size: 1.125rem;
  transition: color 0.3s ease;
  line-height: 50px;
}

/* Default color for menu items (if customizer colors not set) */
.main-navigation .nav-menu > li:nth-of-type(n + 5) a {
  color: var(--avanza-black);
}

/* Hover color is handled by customizer for first 4 items */
/* For items beyond 4, use pink */
.main-navigation .nav-menu > li:nth-of-type(n + 5) a:hover {
  color: var(--avanza-pink);
}

/* Menu item color customization support */
.main-navigation .nav-menu li a {
  transition: all 0.3s ease;
  position: relative;
}

.main-navigation .nav-menu li a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: currentColor;
  transition: width 0.3s ease;
}

.main-navigation .nav-menu li a:hover::after {
  width: 100%;
}

/* Footer Styles */
.avanza-footer {
  background-color: var(--avanza-yellow);
  padding: 40px 0;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  justify-content: space-between;
  align-items: center;
}

.footer-logo-img {
  height: 80px;
  width: auto;
  max-width: 100%;
}

.footer-social {
  display: flex;
  gap: 20px;
  align-items: center;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background-color: var(--avanza-white);
  border-radius: 50%;
  transition: transform 0.3s ease;
}

.social-link:hover {
  transform: scale(1.1);
}

.social-link img {
  width: 20px;
  height: 20px;
}

/* Typography */
.pink-text {
  color: var(--avanza-pink);
}
.yellow-text {
  color: var(--avanza-yellow);
}
.teal-text {
  color: var(--avanza-teal);
}
.blue-text {
  color: var(--avanza-blue);
}
.green-text {
  color: var(--avanza-green);
}
.white-text {
  color: var(--avanza-white);
}
.black-text {
  color: var(--avanza-black);
}

/* Background Colors */
.pink-bg {
  background-color: var(--avanza-pink);
}
.yellow-bg {
  background-color: var(--avanza-yellow);
}
.teal-bg {
  background-color: var(--avanza-teal);
}
.blue-bg {
  background-color: var(--avanza-blue);
}
.green-bg {
  background-color: var(--avanza-green);
}
.white-bg {
  background-color: var(--avanza-white);
}

/* Front Page Styles */
.front-page {
  margin: 0;
  padding: 0;
}

.front-page .container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.section-title {
  margin-bottom: 30px;
  line-height: 1.2;
  width: 100%;
}

.section-text {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--avanza-black);
}

/* Menu Toggle - Hidden on desktop, visible on mobile */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1001;
  position: relative;
  margin-left: auto;
}

.menu-toggle-text {
  font-size: 0.9rem;
  font-weight: 500;
  margin-right: 10px;
}

.menu-toggle-icon {
  display: flex;
  flex-direction: column;
  width: 20px;
  height: 15px;
  justify-content: space-between;
  position: relative;
}

.menu-toggle-icon span {
  display: block;
  height: 2px;
  width: 100%;
  background-color: #333;
  transition: all 0.3s ease;
  position: absolute;
  left: 0;
  top: 50%;
  transform-origin: center;
}

.menu-toggle-icon span:nth-child(1) {
  transform: translateY(-6px);
}

.menu-toggle-icon span:nth-child(2) {
  transform: translateY(0);
}

.menu-toggle-icon span:nth-child(3) {
  transform: translateY(6px);
}

.menu-toggle.active .menu-toggle-icon span:nth-child(1) {
  transform: translateY(0) rotate(45deg);
}

.menu-toggle.active .menu-toggle-icon span:nth-child(2) {
  opacity: 0;
  transform: translateY(0) rotate(0deg);
}

.menu-toggle.active .menu-toggle-icon span:nth-child(3) {
  transform: translateY(0) rotate(-45deg);
}

/* Mobile Navigation Styles */
@media (max-width: 768px) {
  .avanza-header {
    position: relative;
  }

  .header-content {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    padding: 0 20px;
    gap: 15px;
  }

  .menu-toggle {
    display: flex;
    align-items: center;
    order: 1;
    flex-shrink: 0;
    position: absolute;
    top: 0;
    left: 0;
    transform: translate(0, 50%);
    z-index: 9999;
  }

  .avanza-header.pinned .menu-toggle {
    transform: translate(0, 30%);
  }

  .site-branding {
    order: 2;
    flex: 1;
    display: flex;
    justify-content: center;
  }

  .main-navigation {
    position: relative;
    width: 100%;
    max-width: 100%;
    padding: 0;
    display: block;
  }

  .main-navigation ul {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    flex-direction: column;
    padding: 1rem;
    gap: 0;
    margin: 0;
    list-style: none;
  }

  .main-navigation.active ul {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .main-navigation li {
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
  }

  .main-navigation li:last-child {
    border-bottom: none;
  }

  .main-navigation a {
    display: block;
    padding: 15px 0;
    font-size: 1.1rem;
    line-height: normal;
  }

  .avanza-header .avanza-logo-img {
    height: 50px;
  }

  /* Logo smaller when pinned on mobile */
  .avanza-header.pinned .avanza-logo-img {
    height: 40px;
  }

  .footer-logo-img {
    height: 50px;
  }

  .footer-content {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }

  .section-title {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  h2.section-title {
    font-size: 2.5rem;
  }

  p.section-text {
    font-size: 1.25rem;
  }
}

/* Animation Classes */
.fade-in {
  animation: fadeInUp 0.8s ease-out;
}

/* Entry animations for titles and texts */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animation delays */
.animate-on-scroll.delay-1 {
  transition-delay: 0.1s;
}

.animate-on-scroll.delay-2 {
  transition-delay: 0.2s;
}

.animate-on-scroll.delay-3 {
  transition-delay: 0.3s;
}

.animate-on-scroll.delay-4 {
  transition-delay: 0.4s;
}

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

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Button Styles */
.cta-button {
  display: inline-block;
  padding: 15px 30px;
  background-color: var(--avanza-pink);
  color: var(--avanza-white);
  text-decoration: none;
  border-radius: 25px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.cta-button:hover {
  background-color: #d41e5a;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(236, 44, 102, 0.3);
}

.cta-button.teal {
  background-color: var(--avanza-teal);
}

.cta-button.teal:hover {
  background-color: #078a92;
  box-shadow: 0 4px 15px rgba(9, 181, 190, 0.3);
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 40px;
  height: 40px;
  background-color: var(--avanza-pink);
  color: var(--avanza-white);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(236, 44, 102, 0.3);
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background-color: #d41e5a;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(236, 44, 102, 0.4);
}

.back-to-top:active {
  transform: translateY(-1px);
}

.back-to-top span {
  display: block;
  line-height: 1;
}

@media (max-width: 480px) {
  /* Back to Top Button Mobile */
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    font-size: 20px;
  }
}
