/* Global Button Styles */
button[class*="bg-primary"],
a[class*="bg-primary"],
input[type="submit"][class*="bg-primary"] {
  background-color: #F61212;
  color: #ffffff;
  transition: all 0.3s ease;
}

button[class*="bg-primary"]:hover,
a[class*="bg-primary"]:hover,
input[type="submit"][class*="bg-primary"]:hover {
  background-color: #b30d0d;
  color: #ffffff;
  box-shadow: 0 0 20px rgba(179, 13, 13, 0.6);
}

/* Star Border animation (adapted from React Bits, sharp corners per design system) */
.star-border-container {
  display: block;
  position: relative;
  overflow: hidden;
  padding: 2px 0;
}

.star-border-container .border-gradient-bottom {
  position: absolute;
  width: 300%;
  height: 50%;
  opacity: 0.7;
  bottom: -12px;
  right: -250%;
  border-radius: 50%;
  animation: star-movement-bottom linear infinite alternate;
  z-index: 0;
}

.star-border-container .border-gradient-top {
  position: absolute;
  opacity: 0.7;
  width: 300%;
  height: 50%;
  top: -12px;
  left: -250%;
  border-radius: 50%;
  animation: star-movement-top linear infinite alternate;
  z-index: 0;
}

.star-border-container .inner-content {
  position: relative;
  z-index: 1;
}

@keyframes star-movement-bottom {
  0% {
    transform: translate(0%, 0%);
    opacity: 1;
  }
  100% {
    transform: translate(-100%, 0%);
    opacity: 0;
  }
}

@keyframes star-movement-top {
  0% {
    transform: translate(0%, 0%);
    opacity: 1;
  }
  100% {
    transform: translate(100%, 0%);
    opacity: 0;
  }
}

/* Magic Bento (React Bits) adapted: cursor spotlight + border glow + particles */
[data-magic-bento] {
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
  --glow-x: 50%;
  --glow-y: 50%;
  --glow-intensity: 0;
  --glow-radius: 300px;
  --glow-color: 246, 18, 18;
}

[data-magic-bento]::after {
  content: '';
  position: absolute;
  inset: 0;
  padding: 2px;
  background: radial-gradient(
    var(--glow-radius) circle at var(--glow-x) var(--glow-y),
    rgba(var(--glow-color), calc(var(--glow-intensity) * 0.9)) 0%,
    rgba(var(--glow-color), calc(var(--glow-intensity) * 0.4)) 30%,
    transparent 60%
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}

.bento-global-spotlight {
  position: fixed;
  width: 800px;
  height: 800px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 150;
  opacity: 0;
  transform: translate(-50%, -50%);
  mix-blend-mode: screen;
}

@media (max-width: 768px) {
  [data-magic-bento]::after,
  .bento-global-spotlight {
    display: none;
  }
}

/* Nav links: match site's Montserrat typography (size/weight unchanged) */
nav a.font-label-technical {
  font-family: 'Montserrat', sans-serif;
}

/* Form Elements */
input:focus,
textarea:focus,
select:focus {
  border-color: #F61212;
}

/* Logo Loop (adapted from React Bits, vanilla JS/CSS) */
.logoloop {
  position: relative;
  width: 100%;
  overflow-x: hidden;
  overflow-y: visible;
  padding: 12px 0;
  --logoloop-gap: 64px;
  --logoloop-logoHeight: 64px;
  mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
}

.logoloop__track {
  display: flex;
  width: max-content;
  will-change: transform;
  user-select: none;
}

.logoloop__list {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.logoloop__item {
  flex: 0 0 auto;
  margin-right: var(--logoloop-gap);
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--logoloop-logoHeight);
  width: calc(var(--logoloop-logoHeight) * 2.6);
}

.logoloop__item a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
}

.logoloop__item img {
  height: 100%;
  width: 100%;
  max-height: var(--logoloop-logoHeight);
  display: block;
  object-fit: contain;
  opacity: 0.6;
  pointer-events: none;
  -webkit-user-drag: none;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logoloop__item:hover img {
  opacity: 1;
  transform: scale(1.12);
}

@media (prefers-reduced-motion: reduce) {
  .logoloop__track {
    transform: none !important;
  }
}

/* Checkbox and Radio Accent */
input[type="checkbox"]:checked,
input[type="radio"]:checked {
  accent-color: #F61212;
}

/* Motos: badges de estado */
.badge-estado {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: inline-flex;
  align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  padding: 0.35rem 0.75rem;
  color: #ffffff;
}

.badge-estado-static {
  position: static;
  flex-shrink: 0;
}

.badge-nueva { background-color: #15803d; }
.badge-usada { background-color: #1d4ed8; }

/* Proyectos: cards */
.proyecto-card {
  position: relative;
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.proyecto-card:hover {
  transform: translateY(-4px) scale(1.015);
  box-shadow: 0 18px 40px -14px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(246, 18, 18, 0.25);
}

.proyecto-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.proyecto-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms ease;
}

.proyecto-card:hover .proyecto-card-media img {
  transform: scale(1.06);
}

.proyecto-card-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 32%, rgba(0, 0, 0, 0) 58%);
  pointer-events: none;
}

.proyecto-card-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.1rem 1.25rem 1rem;
}

.proyecto-card-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  font-size: 21px;
  line-height: 1.15;
  color: #ffffff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
}

.proyecto-card-ciudad {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #bcc9ce;
  margin-top: 0.3rem;
}

@media (prefers-reduced-motion: reduce) {
  .proyecto-card,
  .proyecto-card-media img { transition: none; }
}

/* Motos: modal */

/* Scrollbar personalizada del contenedor con overflow del modal de detalle
   (#proyectoModalScroll es el div con overflow-y:auto en index.html; #proyectoModal
   en sí ya no scrollea para que el close/toggle queden fijos sobre todo el contenido) */
#proyectoModalScroll {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}
#proyectoModalScroll.is-scrolling {
  scrollbar-color: #F61212 #1a1a1a;
}
#proyectoModalScroll::-webkit-scrollbar {
  width: 6px;
}
#proyectoModalScroll::-webkit-scrollbar-track {
  background: transparent;
}
#proyectoModalScroll::-webkit-scrollbar-thumb {
  background-color: transparent;
  transition: background-color 200ms ease;
}
#proyectoModalScroll.is-scrolling::-webkit-scrollbar-thumb {
  background-color: #F61212;
}

.proyecto-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(14, 14, 14, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #ffffff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  z-index: 20;
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.proyecto-modal-close:hover {
  background: #F61212;
  border-color: #F61212;
  transform: scale(1.05);
}

.proyecto-modal-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0e0e0e;
}

.proyecto-modal-hero .proyecto-galeria-main,
.proyecto-modal-hero .proyecto-placeholder {
  position: absolute;
  inset: 0;
}

.proyecto-modal-hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8, 8, 8, 0.94) 0%, rgba(8, 8, 8, 0.4) 42%, rgba(8, 8, 8, 0) 72%);
  pointer-events: none;
}

.proyecto-modal-hero-text {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.5rem 1.75rem 1.35rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.proyecto-modal-hero-text h2 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  font-size: 26px;
  line-height: 1.15;
  color: #ffffff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6);
}

.proyecto-modal-content {
  padding: 1.75rem 1.75rem 2rem;
}

.proyecto-galeria-main {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.proyecto-galeria-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.galeria-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(19, 19, 19, 0.7);
  color: #fff;
  border: none;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  z-index: 5;
}

.galeria-nav:hover { background: #F61212; }
.galeria-prev { left: 0.5rem; }
.galeria-next { right: 0.5rem; }

.proyecto-galeria-thumbs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  overflow-x: auto;
}

.proyecto-galeria-thumbs img {
  width: 4.5rem;
  height: 3rem;
  object-fit: cover;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}

.proyecto-galeria-thumbs img.is-active,
.proyecto-galeria-thumbs img:hover {
  opacity: 1;
  outline: 2px solid #F61212;
}

.proyecto-modal-soft {
  margin-bottom: 1.75rem;
}

.proyecto-modal-location {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #F61212;
  margin-bottom: 0.85rem;
}

.proyecto-modal-sector {
  color: #bcc9ce;
}

.proyecto-modal-desc {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: #EDEDED;
}

.proyecto-modal-specs {
  margin-top: 2rem;
  padding: 1.5rem;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.proyecto-modal-specs-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #869398;
  margin-bottom: 1.1rem;
}

.proyecto-modal-specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .proyecto-modal-specs-grid { grid-template-columns: repeat(3, 1fr); }
}

.proyecto-modal-spec {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.proyecto-modal-spec .material-symbols-outlined {
  color: #F61212;
  font-size: 22px;
  flex-shrink: 0;
}

.proyecto-modal-spec .spec-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #869398;
}

.proyecto-modal-spec .spec-value {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: #ffffff;
}

.proyecto-modal-extras {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.proyecto-modal-extras-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.proyecto-modal-extra-chip {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #ffffff;
  padding: 0.45rem 0.9rem;
  background: rgba(246, 18, 18, 0.08);
  border: 1px solid rgba(246, 18, 18, 0.3);
}

.proyecto-modal-cta {
  margin-top: 1.75rem;
}

/* Motos: placeholder cuando la galería viene vacía desde Supabase
   (ver renderPlaceholder() en js/motos.js). Se reemplaza automáticamente
   por la imagen real en cuanto el registro tenga fotos. */
.proyecto-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  background-color: #0E0E0E;
  background-image: radial-gradient(circle at 30% 20%, rgba(246, 18, 18, 0.10), transparent 55%),
                     radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.04), transparent 50%);
}

.proyecto-placeholder-text {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  color: #FFFFFF;
  font-size: 22px;
  line-height: 1.2;
}
