/* components.css - Reusable UI components */

/* Buttons */
.btn-accent {
  background-color: #e11d48;
  color: #ffffff;
  border: 1px solid #e11d48;
  transition: background-color 0.2s, transform 0.2s;
}

.btn-accent:hover {
  background-color: #be123c;
  color: #ffffff;
  border-color: #be123c;
  transform: translateY(-1px);
}

.ui-btn-primary {
  background-color: #e11d48 !important;
  color: #ffffff !important;
  border: 2.5px solid #0f172a !important;
  border-radius: 6px !important;
  font-weight: 800 !important;
  font-size: 1.05rem !important;
  padding: 0.85rem 1.8rem !important;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 4px 4px 0px #0f172a;
  text-decoration: none;
  transition: all 0.15s ease;
}

.ui-btn-primary:hover {
  background-color: #be123c !important;
  color: #ffffff !important;
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px #0f172a;
}

.ui-btn-primary:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0px #0f172a;
}

/* Small button variant for cards and tables */
.ui-btn-primary.btn-sm,
.ui-btn-secondary.btn-sm {
  min-height: 38px !important;
  padding: 0.45rem 1.1rem !important;
  font-size: 0.88rem !important;
  box-shadow: 2.5px 2.5px 0px #0f172a !important;
}

.ui-btn-primary.btn-sm:hover,
.ui-btn-secondary.btn-sm:hover {
  transform: translate(-1.5px, -1.5px);
  box-shadow: 4px 4px 0px #0f172a !important;
}

.ui-btn-secondary {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border: 2.5px solid #0f172a !important;
  border-radius: 6px !important;
  font-weight: 800 !important;
  font-size: 1rem !important;
  padding: 0.85rem 2rem !important;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 4px 4px 0px #0f172a;
  transition: all 0.15s ease;
}

.ui-btn-secondary:hover {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px #0f172a;
}

.ui-btn-secondary:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0px #0f172a;
}

.ui-btn-back {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border: 2px solid #0f172a !important;
  border-radius: 6px !important;
  font-weight: 700 !important;
  font-size: 0.9rem !important;
  padding: 0.5rem 1.15rem !important;
  box-shadow: 2px 2px 0px #0f172a;
  text-decoration: none;
  transition: all 0.15s ease;
}

.ui-btn-back:hover {
  background-color: #0f172a !important;
  color: #ffffff !important;
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0px #0f172a;
}

/* Cards */
.ui-card {
  background-color: #ffffff;
  border: 2.5px solid #0f172a;
  border-radius: 8px;
  box-shadow: 4px 4px 0px #0f172a;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
}

.ui-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px #0f172a;
}

.ui-card-img-wrap {
  background-color: #f8fafc;
  border-bottom: 2px solid #0f172a;
  padding: 1rem;
  text-align: center;
}

.ui-card-img {
  height: 190px;
  width: 100%;
  object-fit: contain;
}

.ui-card-price {
  font-weight: 800;
  font-size: 1.45rem;
  color: #e11d48;
}

.ui-card-unit {
  color: #64748b;
  font-size: 0.85rem;
}

/* Bike detail */
.ui-bike-detail-img {
  max-height: 380px;
  width: 100%;
  object-fit: contain;
}

.ui-price-box {
  background-color: #f8fafc;
  border: 2px solid #0f172a;
  border-radius: 6px;
  box-shadow: 2.5px 2.5px 0px #0f172a;
}

.ui-price-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
}

.ui-price-val {
  font-size: 1.45rem;
  font-weight: 900;
  color: #e11d48;
}

.ui-calc-box {
  background-color: #f8fafc;
  border: 2px solid #0f172a;
  border-radius: 6px;
  box-shadow: 2.5px 2.5px 0px #0f172a;
}

/* Badges */
.ui-service-badge {
  display: inline-block;
  background-color: #f1f5f9;
  border: 2px solid #0f172a;
  border-radius: 4px;
  padding: 0.35rem 0.85rem;
  box-shadow: 2px 2px 0px #0f172a;
}

.ui-service-badge span {
  font-size: 0.75rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.ui-badge-dark {
  background-color: #0f172a !important;
  color: #ffffff !important;
  border: 1.5px solid #0f172a !important;
  font-weight: 800 !important;
  font-size: 0.72rem !important;
  letter-spacing: 0.5px !important;
  border-radius: 4px !important;
  padding: 0.35rem 0.65rem !important;
}

.ui-badge-status-disponible {
  background-color: #10b981 !important;
  color: #ffffff !important;
  border: 1.5px solid #0f172a !important;
  font-weight: 800 !important;
  font-size: 0.72rem !important;
  border-radius: 4px !important;
  padding: 0.35rem 0.65rem !important;
  box-shadow: 1.5px 1.5px 0px #0f172a;
}

.ui-badge-status-llogada {
  background-color: #f59e0b !important;
  color: #0f172a !important;
  border: 1.5px solid #0f172a !important;
  font-weight: 800 !important;
  font-size: 0.72rem !important;
  border-radius: 4px !important;
  padding: 0.35rem 0.65rem !important;
  box-shadow: 1.5px 1.5px 0px #0f172a;
}

.ui-badge-status-averiada {
  background-color: #ef4444 !important;
  color: #ffffff !important;
  border: 1.5px solid #0f172a !important;
  font-weight: 800 !important;
  font-size: 0.72rem !important;
  border-radius: 4px !important;
  padding: 0.35rem 0.65rem !important;
  box-shadow: 1.5px 1.5px 0px #0f172a;
}

/* Bike showcase */
.ui-bike-frame {
  background-color: #ffffff;
  border: 2.5px solid #0f172a;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 4px 4px 0px #0f172a;
}

.ui-bike-canvas {
  padding: 2rem 1.5rem 1.25rem 1.5rem;
  min-height: 310px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

@keyframes bikeRide {
  0% { transform: translateY(0px) rotate(0deg); }
  25% { transform: translateY(-7px) rotate(-1.5deg); }
  50% { transform: translateY(0px) rotate(0deg); }
  75% { transform: translateY(-5px) rotate(1.5deg); }
  100% { transform: translateY(0px) rotate(0deg); }
}

@keyframes bikeShadow {
  0%, 50%, 100% { transform: scaleX(1); opacity: 0.25; }
  25%, 75% { transform: scaleX(0.85); opacity: 0.15; }
}

.ui-bike-img {
  max-height: 280px;
  width: auto;
  object-fit: contain;
  animation: bikeRide 3.5s ease-in-out infinite;
  filter: drop-shadow(0 12px 20px rgba(15, 23, 42, 0.12));
}

.bike-shadow-el {
  width: 210px;
  height: 14px;
  background: radial-gradient(ellipse at center, rgba(15, 23, 42, 0.35) 0%, rgba(15, 23, 42, 0) 70%);
  border-radius: 50%;
  margin-top: 0.5rem;
  animation: bikeShadow 3.5s ease-in-out infinite;
}

/* CO2 impact box */
.ui-co2-impact-box {
  background-color: #ffffff;
  border: 2.5px solid #0f172a;
  border-radius: 8px;
  padding: 1.35rem 1.5rem;
  box-shadow: 4px 4px 0px #0f172a;
}

.ui-co2-badge {
  background-color: #0f172a !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  font-size: 0.72rem !important;
  letter-spacing: 0.5px !important;
  padding: 0.35rem 0.65rem !important;
  border-radius: 4px !important;
}

.ui-co2-live-tag {
  font-size: 0.72rem;
  font-weight: 800;
  color: #059669;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseDot 1.8s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.ui-co2-value {
  font-size: clamp(2.2rem, 3.5vw, 3rem);
  font-weight: 900;
  color: #e11d48;
  line-height: 1;
  letter-spacing: -1.5px;
}

.ui-co2-unit {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
}

.ui-co2-desc {
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.45;
  margin: 0;
}

.ui-co2-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.ui-co2-stat-chip {
  background-color: #f8fafc;
  border: 1.5px solid #0f172a;
  border-radius: 6px;
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-direction: column;
}

.ui-co2-stat-chip .chip-number {
  font-size: 1.25rem;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.1;
}

.ui-co2-stat-chip .chip-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  margin-top: 0.2rem;
}

/* Form inputs */
.ui-form-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #0f172a;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.ui-form-control {
  border: 2px solid #0f172a !important;
  border-radius: 6px !important;
  padding: 0.65rem 0.85rem !important;
  font-weight: 600 !important;
  color: #0f172a !important;
  background-color: #ffffff !important;
  box-shadow: 2px 2px 0px #0f172a;
  transition: all 0.15s ease;
}

.ui-form-control:focus {
  border-color: #e11d48 !important;
  outline: none !important;
  box-shadow: 3px 3px 0px #e11d48 !important;
}

/* Preloader overlay */
.preloader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #0f172a;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.preloader-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-bike-img {
  max-height: 80px;
  width: auto;
  filter: brightness(0) invert(1);
  animation: preloaderRide 1.2s ease-in-out infinite alternate;
}

@keyframes preloaderRide {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-8px) rotate(-3deg); }
}

.preloader-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin-top: 1rem;
}

.preloader-dots .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #e11d48;
  display: inline-block;
  animation: dotBounce 1.4s infinite ease-in-out both;
}

.preloader-dots .dot:nth-child(1) { animation-delay: -0.32s; }
.preloader-dots .dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(0.4); opacity: 0.3; }
  40% { transform: scale(1.15); opacity: 1; background-color: #ffffff; }
}

.preloader-text {
  display: block;
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 0.75rem;
}

.review-avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #0f172a;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  border: 1.5px solid #0f172a;
}

.review-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: #0f172a;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  border: 2px solid #0f172a;
}

.review-avatar-lg {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background-color: #0f172a;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 2rem;
  border: 2.5px solid #0f172a;
}

.nav-avatar-initial {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #0f172a;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
}

.nav-avatar-img {
  width: 32px;
  height: 32px;
  max-width: 32px;
  max-height: 32px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  object-fit: cover;
  display: inline-block;
}

.admin-avatar-img {
  width: 36px;
  height: 36px;
  max-width: 36px;
  max-height: 36px;
  border-radius: 50%;
  border: 1.5px solid #0f172a;
  object-fit: cover;
  display: inline-block;
  vertical-align: middle;
}

.ui-avatar-img {
  width: 88px;
  height: 88px;
  max-width: 88px;
  max-height: 88px;
  border-radius: 50%;
  object-fit: cover;
  display: inline-block;
}

.ui-text-preline {
  white-space: pre-line;
}

.ui-badge-xs {
  font-size: 0.65rem;
}

.star-rating {
  display: inline-flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  font-size: 1.8rem;
}

.star-rating input {
  display: none;
}

.star-rating label {
  color: #cbd5e1;
  cursor: pointer;
  transition: color 0.2s ease-in-out;
  padding: 0 0.15rem;
}

.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label {
  color: #f59e0b;
}

.stars-gold {
  color: #f59e0b;
  letter-spacing: 2px;
}

.ui-modal-content {
  background-color: #ffffff;
  border: 2.5px solid #0f172a;
  border-radius: 8px;
  box-shadow: 6px 6px 0px #0f172a;
  overflow: hidden;
}

/* Category Carousel Slider */
#categoryCarousel .carousel-control-prev,
#categoryCarousel .carousel-control-next {
  width: 44px;
  height: 44px;
  top: 40%;
  border-radius: 50%;
  background-color: #0f172a;
  opacity: 0.9;
  border: 2px solid #0f172a;
  box-shadow: 2px 2px 0px #0f172a;
}

#categoryCarousel .carousel-control-prev {
  left: -22px;
}

#categoryCarousel .carousel-control-next {
  right: -22px;
}

#categoryCarousel .carousel-indicators [data-bs-target] {
  background-color: #0f172a;
  width: 24px;
  height: 4px;
  border-radius: 2px;
}

@media (max-width: 768px) {
  #categoryCarousel .carousel-control-prev {
    left: 4px;
  }
  #categoryCarousel .carousel-control-next {
    right: 4px;
  }
}

/* Gallery & Lightbox Slider */
.gallery-img-container {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background-color: #f8fafc;
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 2px solid #0f172a;
}

.gallery-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-img-container:hover .gallery-thumbnail {
  transform: scale(1.05);
}

.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.gallery-img-container:hover .gallery-overlay {
  opacity: 1;
}

.gallery-zoom-badge {
  background: #0f172a;
  color: #ffffff;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1.5px solid #ffffff;
}

/* Fancybox Custom Styling */
.fancybox__caption {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.95rem;
  text-align: center;
  padding: 1rem 1.5rem;
  background: rgba(15, 23, 42, 0.92);
  color: #ffffff;
}
