/* ==========================================================================
   ACADEMIA MARINARE - MODERN DESIGN SYSTEM & STYLESHEET
   Barrio del Cristo (Aldaia - Quart de Poblet)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Rubik:wght@400;500;600;700;800&display=swap');

:root {
  /* Brand Palette */
  --primary: #6528F7;
  --primary-hover: #5511F8;
  --primary-light: #EEF2FF;
  --primary-glow: rgba(101, 40, 247, 0.25);
  
  --secondary: #0F172A;
  --secondary-light: #1E293B;
  
  --accent-gold: #F59E0B;
  --accent-teal: #0EA5E9;
  --accent-green: #10B981;
  --whatsapp-color: #25D366;
  
  /* Neutral Colors */
  --bg-main: #FAFAFC;
  --bg-card: #FFFFFF;
  --bg-alt: #F1F5F9;
  --border: #E2E8F0;
  
  --text-main: #1E293B;
  --text-muted: #64748B;
  --text-white: #FFFFFF;
  
  /* Shadows & Radius */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 40px rgba(101, 40, 247, 0.12);
  --shadow-hover: 0 14px 30px rgba(101, 40, 247, 0.2);
  
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s ease;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Rubik', sans-serif;
  color: var(--secondary);
  line-height: 1.25;
  font-weight: 700;
}

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

a:hover {
  color: var(--primary-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Container */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header & Navigation */
.header {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  transition: all var(--transition-normal);
}

.header.scrolled {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.logo img {
  height: 48px;
  width: auto;
  transition: transform var(--transition-fast);
}

.logo:hover img {
  transform: scale(1.03);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-link {
  font-weight: 500;
  color: var(--secondary);
  padding: 0.5rem 0;
  position: relative;
  font-size: 1.05rem;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-hover));
  border-radius: var(--radius-full);
  transition: width var(--transition-normal);
}

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

.nav-link.active {
  color: var(--primary);
  font-weight: 600;
}

/* Dropdown */
.nav-item-dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: #FFFFFF;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  padding: 0.75rem;
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  list-style: none;
}

@media (min-width: 769px) {
  .nav-item-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
  }
}

.dropdown-item a {
  display: block;
  padding: 0.6rem 1rem;
  color: var(--secondary);
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.dropdown-item a:hover {
  background: var(--primary-light);
  color: var(--primary);
}

/* Mobile Toggle */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--secondary);
  cursor: pointer;
  padding: 0.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
  cursor: pointer;
  border: none;
  font-size: 1rem;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: var(--text-white);
  box-shadow: var(--shadow-lg);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  color: var(--text-white);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--text-white);
  transform: translateY(-2px);
}

.btn-whatsapp {
  background: var(--whatsapp-color);
  color: var(--text-white);
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp:hover {
  background: #20ba59;
  color: var(--text-white);
  transform: translateY(-2px);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 1rem;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Hero Section */
.hero {
  padding: 5rem 0 4rem;
  position: relative;
  background: radial-gradient(circle at 90% 10%, rgba(101, 40, 247, 0.08) 0%, transparent 60%);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3.5rem;
  align-items: center;
}

.hero-title {
  font-size: 3.25rem;
  margin: 1.25rem 0;
  letter-spacing: -0.02em;
}

.hero-title span.highlight {
  background: linear-gradient(135deg, var(--primary) 0%, #A855F7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 90%;
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-image-wrapper {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transform: perspective(1000px) rotateY(-4deg);
  transition: transform var(--transition-slow);
}

.hero-image-wrapper:hover {
  transform: perspective(1000px) rotateY(0deg);
}

.hero-image-wrapper img {
  width: 100%;
  object-fit: cover;
  border-radius: var(--radius-lg);
}

/* Cards Section */
.section {
  padding: 5rem 0;
}

.section-alt {
  background-color: var(--bg-alt);
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3.5rem;
}

.section-title {
  font-size: 2.25rem;
  margin-top: 0.75rem;
}

.section-description {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-top: 0.75rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem;
}

/* Card Styling */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-md);
  border-color: rgba(101, 40, 247, 0.3);
}

.card-img {
  height: 220px;
  width: 100%;
  object-fit: cover;
}

.card-body {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-title {
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
}

.card-text {
  color: var(--text-muted);
  font-size: 0.975rem;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

/* Teacher Card Styling */
.teacher-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 2rem 1.5rem 1.75rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.teacher-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-md);
  border-color: rgba(101, 40, 247, 0.35);
}

.teacher-avatar-wrapper {
  position: relative;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  padding: 5px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 10px 25px -5px rgba(101, 40, 247, 0.3);
  margin-bottom: 1.25rem;
  transition: transform var(--transition-normal);
}

.teacher-card:hover .teacher-avatar-wrapper {
  transform: scale(1.05);
}

.teacher-avatar-wrapper img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center; /* Fixes forehead cropping completely */
  background: #F1F5F9;
}

/* Feature Box */
.feature-box {
  display: flex;
  gap: 1.25rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: all var(--transition-normal);
}

.feature-box:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

/* Accordion */
.accordion {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 850px;
  margin: 0 auto;
}

.accordion-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.accordion-header {
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--secondary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.accordion-header::after {
  content: '+';
  font-size: 1.4rem;
  color: var(--primary);
  transition: transform var(--transition-fast);
}

.accordion-item.active .accordion-header::after {
  content: '−';
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-normal);
  padding: 0 1.5rem;
  color: var(--text-muted);
}

.accordion-item.active .accordion-content {
  padding: 0 1.5rem 1.5rem;
  max-height: 500px;
}

/* Contact Form */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--secondary);
}

.form-control {
  width: 100%;
  padding: 0.9rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  background: #FFFFFF;
  transition: all var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

textarea.form-control {
  resize: vertical;
  min-height: 140px;
}

.form-alert {
  padding: 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  display: none;
}

.form-alert.success {
  background: #D1FAE5;
  color: #065F46;
  border: 1px solid #A7F3D0;
  display: block;
}

.form-alert.error {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FECACA;
  display: block;
}

/* Floating WhatsApp Button */
.whatsapp-float {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 60px;
  height: 60px;
  background-color: var(--whatsapp-color);
  color: #FFF;
  border-radius: 50px;
  text-align: center;
  font-size: 32px;
  box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  animation: pulse-green 2s infinite;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  color: #FFF;
}

@keyframes pulse-green {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
  70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* Footer */
.footer {
  background: var(--secondary);
  color: #94A3B8;
  padding: 4.5rem 0 2rem;
  font-size: 0.95rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 3rem;
  margin-bottom: 3.5rem;
}

.footer-brand img {
  height: 42px;
  margin-bottom: 1.25rem;
  filter: brightness(0) invert(1);
}

.footer-title {
  color: #FFFFFF;
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: #94A3B8;
}

.footer-links a:hover {
  color: #FFFFFF;
}

.footer-bottom {
  border-top: 1px solid #334155;
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Animations */
[data-animate] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate].animated {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 1024px) {
  .hero-grid, .contact-grid {
    grid-template-columns: 1fr;
  }
  
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .mobile-toggle {
    display: block;
  }
  
  .nav-links {
    position: fixed;
    top: 80px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 80px);
    background: #FFFFFF;
    flex-direction: column;
    padding: 2rem;
    gap: 1.25rem;
    transition: left var(--transition-normal);
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    align-items: center;
  }
  
  .nav-links.open {
    left: 0;
  }

  .nav-item-dropdown {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .nav-item-dropdown > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
  }

  .nav-item-dropdown > a i {
    transition: transform var(--transition-normal);
  }

  .nav-item-dropdown.open > a i {
    transform: rotate(180deg);
  }

  .dropdown-menu {
    position: static !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    box-shadow: none !important;
    border: 1px solid var(--border) !important;
    background: #F8FAFC !important;
    margin-top: 0.5rem !important;
    padding: 0.5rem !important;
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    border-radius: var(--radius-md) !important;
    width: 100% !important;
    max-width: 280px !important;
    min-width: 0 !important;
    text-align: center !important;
  }

  .nav-item-dropdown.open .dropdown-menu {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    height: auto !important;
  }
  
  .hero-title {
    font-size: 2.25rem;
  }
  
  .grid-3, .grid-2 {
    grid-template-columns: 1fr;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

/* Lightbox Modal Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  background: var(--bg-alt);
  aspect-ratio: 4 / 3;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.gallery-item:hover img {
  transform: scale(1.08);
}

.gallery-item::after {
  content: '\ebfc'; /* Remixicon zoom-in icon */
  font-family: 'remixicon';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.45);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.gallery-item:hover::after {
  opacity: 1;
}

.lightbox-modal {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.lightbox-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-img-wrapper {
  position: relative;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  object-fit: contain;
  transition: transform 0.25s ease;
}

.lightbox-caption {
  color: #F8FAFC;
  margin-top: 1.25rem;
  font-size: 1.05rem;
  font-weight: 500;
  text-align: center;
}

.lightbox-btn {
  position: absolute;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #FFFFFF;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  backdrop-filter: blur(4px);
}

.lightbox-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(1.1);
}

.lightbox-prev {
  left: 2rem;
}

.lightbox-next {
  right: 2rem;
}

.lightbox-close {
  top: 2rem;
  right: 2rem;
}

@media (max-width: 640px) {
  .lightbox-prev { left: 0.75rem; }
  .lightbox-next { right: 0.75rem; }
  .lightbox-close { top: 1rem; right: 1rem; }
}

