/* ---
    Steadigimbal - High-Fidelity Recreation CSS (Updated with global orange progress bar)
    --- */

:root {
  /* Light Theme (Default) */
  --bg-color: #ffffff;
  --text-color: #1a1a1a;
  --text-color-light: #555555;
  --accent-color: #ff8c00;              /* Naranja principal */
  --accent-hover-color: #e67e00;
  --skeleton-bg: #eeeeee;               /* Fondo gris claro para skeleton */
  --loading-bg: rgba(0, 0, 0, 0.5);     /* Fondo semi-transparente para loading */
  --progress-bg: rgba(255, 255, 255, 0.25); /* Fondo de la barra */
  --font-stack: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

/* --- Base & Typography --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 15px;
}

body {
  font-family: var(--font-stack);
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.4s ease, color 0.4s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

/* --- Preloader con barra de progreso proporcional --- */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-color);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.loader-text {
  font-size: 1.2rem;
  color: var(--text-color-light);
  margin-bottom: 1rem;
}

.preloader-progress-container {
  width: 80%;
  max-width: 300px;
  height: 10px;
  background: var(--progress-bg);
  border-radius: 5px;
  overflow: hidden;
}

.preloader-progress-bar {
  height: 100%;
  width: 0; /* Empieza en 0% */
  background: var(--accent-color); /* Naranja */
  transition: width 0.4s ease; /* Transición suave */
  border-radius: 5px;
}

/* --- SPA Layout --- */
.page {
  width: 100%;
  min-height: 100vh;
  padding: 5vh 5vw 200px 5vw;
}

/* --- Site Header (Top Left) --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 30px 40px;
  z-index: 1000;
  pointer-events: none;
  background-color: rgba(255, 255, 255, 0);
  transition: padding 0.4s ease, background-color 0.4s ease;
}

.site-header.scrolled {
  padding: 15px 40px;
  background-color: rgba(255, 255, 255, 0.7);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.site-header .logo {
  pointer-events: all;
  font-size: 1.2rem;
  font-weight: 600;
  transition: font-size 0.4s ease;
}

.site-header.scrolled .logo {
  font-size: 1rem;
}

/* --- Fixed Footer & Navigation --- */
.fixed-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 15px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  pointer-events: none;
  background-color: rgba(255, 255, 255, 0.7);
}

.fixed-footer > * {
  pointer-events: all;
}

.main-nav a,
.utility-nav a,
.utility-nav button {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-color);
  margin: 0 10px;
  transition: color 0.3s ease;
}

.main-nav a {
  position: relative;
  padding-bottom: 3px;
}

.main-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1.5px;
  background-color: var(--accent-color);
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.3s ease-out;
}

.main-nav a:hover::after,
.main-nav a.active::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

.main-nav a.active {
  color: var(--text-color);
}

.social-links a:hover {
  color: var(--accent-color);
}

.utility-nav {
  display: flex;
  align-items: center;
}

.social-links {
  margin-right: 20px;
}

.utility-nav button {
  background: none;
  border: none;
  cursor: pointer;
}

.utility-nav button svg {
  width: 18px;
  height: 18px;
  stroke: var(--text-color);
  transition: stroke 0.3s ease;
}

.utility-nav button:hover svg {
  stroke: var(--accent-color);
}

/* --- Language Switcher --- */
.language-switcher {
  position: relative;
}

.language-dropdown {
  display: none;
  position: absolute;
  bottom: 150%;
  right: 0;
  background-color: #ffffff;
  border-radius: 5px;
  padding: 5px 0;
  min-width: 120px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  border: 1px solid var(--text-color-light);
  pointer-events: all;
  z-index: 1001;
}

.language-dropdown.show {
  display: block;
}

.language-dropdown a {
  display: block;
  color: var(--text-color);
  padding: 8px 15px;
}

.language-dropdown a:hover,
.language-dropdown a.active {
  background-color: var(--accent-color);
  color: white;
}

/* --- Work Page: Single Column Video Layout --- */
#work {
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 15vh;
  padding-bottom: 15vh;
}

#work-gallery.grid-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10vh;
  width: 100%;
}

.grid-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  width: 100%;
  max-width: 70vw;
}

.video-item {
  aspect-ratio: 16 / 9;
  background: var(--skeleton-bg);               /* Fondo gris claro como base */
  min-height: 200px;                            /* Evita saltos */
  position: relative;
}

/* Capa de loading con barra de progreso */
.video-item::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background: var(--loading-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease;
  background: rgba(0, 0, 0, 0.3); /* más transparente */
}

.video-item.loaded::before {
  opacity: 0;
  pointer-events: none;
}

/* Contenedor y barra de progreso naranja */
.video-item .progress-container {
  width: 70%;
  max-width: 280px;
  height: 8px;
  background: var(--progress-bg);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.video-item .progress-bar {
  width: 0;
  height: 100%;
  background: var(--accent-color); /* Naranja #ff8c00 */
  border-radius: 4px;
  animation: progressIndeterminate 2.2s linear infinite;
}

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

.video-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
}

.video-item.loaded video {
  opacity: 1;
  transform: scale(1.02);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.image-item {
  width: 100%;
  max-width: 50vw;
}

.image-item img {
  height: auto;
  object-fit: contain;
  width: 100%;
}

.grid-item:hover video,
.grid-item:hover img {
  transform: none;
}

.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.grid-item:hover .video-overlay {
  opacity: 1;
  visibility: visible;
}

.video-title {
  color: white;
  font-size: 1rem;
  text-align: center;
  padding: 0;
  background-color: transparent;
  border-radius: 0;
}

/* --- Gear & Info Pages --- */
.content-container {
  max-width: 900px;
  margin: 10vh auto;
}

.content-container h2 {
  font-size: 2.5rem;
  font-weight: 600;
  margin-bottom: 3rem;
}

#gear-list {
  width: 100%;
  border-top: 1px solid var(--text-color-light);
}

.accordion-item {
  border-bottom: 1px solid var(--text-color-light);
}

.accordion-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 2rem 0;
  cursor: pointer;
  gap: 1.5rem;
}

.accordion-header h3 {
  font-size: 2rem;
  font-weight: 500;
}

.accordion-icon {
  font-size: 3.5rem;
  font-weight: bold;
  line-height: 1;
  transition: transform 0.3s ease;
}

.accordion-content {
  height: 0;
  overflow: hidden;
}

.accordion-content p {
  padding-bottom: 2rem;
  font-size: 1.2rem;
  color: var(--text-color-light);
  max-width: 80%;
}

.accordion-item.active .accordion-icon {
  transform: rotate(45deg);
}

.info-content p {
  font-size: 1.2rem;
  color: var(--text-color-light);
  margin-bottom: 1.5rem;
}

.info-content .contact-button {
  color: var(--accent-color);
  font-weight: 600;
  font-size: 1.2rem;
}

/* --- Modal --- */
#videoModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 9998;
  display: none;
  align-items: center;
  justify-content: center;
}

#videoModal.active {
  display: flex;
}

.modal-content {
  width: 90%;
  max-width: 1200px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-viewer {
  display: none;
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
}

.modal-content video.modal-viewer {
  width: 100%;
  height: auto;
}

.modal-content img.modal-viewer {
  width: 50%;
  height: auto;
  max-width: 50%;
  max-height: 90vh;
}

.modal-close {
  position: absolute;
  top: 30px;
  right: 40px;
  font-size: 2.5rem;
  color: #fff;
  cursor: pointer;
}

/* --- Responsive Styles --- */
@media (max-width: 768px) {
  .fixed-footer {
    flex-direction: column;
    padding: 10px 20px;
    align-items: center;
  }

  .main-nav {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
  }

  .main-nav a {
    margin: 0 8px;
  }

  .utility-nav {
    width: 100%;
    justify-content: center;
  }

  .social-links {
    margin-right: 15px;
  }

  .video-item {
    min-height: 180px;
  }

  .progress-container {
    width: 80%;
  }
}

/* === FORMULARIO DE CONTACTO - Estilo profesional === */
.form-wrapper {
  margin-top: 2.5rem;
  max-width: 680px;
  width: 100%;
}

#contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}

#contact-form:hover {
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.form-group label {
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--text-color);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 1rem 1.2rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.4);
  transition: all 0.3s ease;
  color: var(--text-color);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.15);
  background: white;
}

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

#contact-form button {
  align-self: flex-start;
  padding: 0.9rem 2.2rem;
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

#contact-form button:hover {
  background: var(--accent-hover-color);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 140, 0, 0.25);
}

#form-message {
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
  font-size: 1.05rem;
}

/* Mensaje éxito */
#form-message.success {
  background: rgba(76, 175, 80, 0.15);
  color: #2e7d32;
  border: 1px solid rgba(76, 175, 80, 0.4);
}

/* Mensaje error */
#form-message.error {
  background: rgba(244, 67, 54, 0.15);
  color: #c62828;
  border: 1px solid rgba(244, 67, 54, 0.4);
}

/* Aviso RGPD */
.gdpr-notice {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-color-light);
  line-height: 1.5;
  text-align: center;
}

.gdpr-notice a {
  color: var(--accent-color);
  text-decoration: underline;
}

.gdpr-notice a:hover {
  color: var(--accent-hover-color);
}

/* Responsive */
@media (max-width: 768px) {
  #contact-form {
    padding: 1.6rem;
  }

  .form-group label {
    font-size: 1rem;
  }
}
/* Mover el badge de reCAPTCHA v3 hacia arriba para que no se tape con el footer fijo */
.grecaptcha-badge {
  bottom: 90px !important;     /* Sube 90px desde abajo – ajusta este valor si necesitas más/menos */
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2) !important; /* Opcional: sombra para que se vea mejor */
  z-index: 999 !important;     /* Asegura que esté por encima del footer si hace falta */
}

/* Opcional: Si quieres hacerlo aún más discreto (pero sigue cumpliendo con Google) */
.grecaptcha-badge:hover {
  transform: scale(1.1);       /* Pequeño zoom al pasar el ratón */
}

.grecaptcha-badge { visibility: hidden !important; }