/* Shared gear UI styles used by both index.html and gear.html */

/*--------------------------------------------------------------
# Gear Animations
--------------------------------------------------------------*/
@keyframes gearFadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gearPulseIn {
  0%   { opacity: 0; transform: scale(0.92); }
  60%  { transform: scale(1.02); }
  100% { opacity: 1; transform: scale(1); }
}

h5 {
  text-transform: uppercase !important;
  font-size: 90% !important;
}

.badge-pill {
  cursor: pointer;
  padding-right: 0.25em !important;
  padding-left: 0.25em !important;
  border-radius: 0.25em !important;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.badge-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(34, 9, 1, 0.15);
}

.badge-pill:active {
  transform: scale(0.95);
}

.badge {
  line-height: 1.2 !important;
  padding: 0.25em !important;
  margin: 0.25em !important;
}

.selected-pill {
  background-color: var(--rusty-spice) !important;
  color: #fff !important;
}

#searchBox {
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(34, 9, 1, 0.15);
  border-radius: 8px;
  background-color: #fff !important;
  color: #000 !important;
}

#searchBox:focus {
  border-color: var(--rusty-spice);
  box-shadow: 0 0 0 3px rgba(188, 57, 8, 0.15);
  outline: none;
}

.card-columns {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

@media (max-width: 480px) {
  .card-columns {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
  }
  .card-text img {
    max-height: 72px !important;
    max-width: 75% !important;
  }
  .card-title {
    font-size: 70% !important;
  }
}

.card {
  overflow: hidden !important;
  text-align: center !important;
  background-color: var(--soft-linen) !important;
  box-shadow: 0 4px 12px rgba(34, 9, 1, 0.06) !important;
  transition: transform 0.3s ease, box-shadow 0.3s ease !important;
  animation: gearFadeInUp 0.4s ease both;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(34, 9, 1, 0.14) !important;
}

.card-title {
  font-size: 80% !important;
}

.card-body {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  padding: 1.25rem 1.5rem !important;
}

.card-text {
  width: 100%;
  position: relative !important;
  overflow: hidden !important;
}

.card-text img {
  width: 100% !important;
  object-fit: contain !important;
  max-height: 96px !important;
  max-width: 288px !important;
  transition: transform 0.3s ease;
}

.card:hover .card-text img {
  transform: scale(1.05);
}

.popover {
  max-width: 100% !important;
  animation: gearPulseIn 0.2s ease both;
}

.popover h3 {
  font-size: 1.2em;
  text-transform: uppercase !important;
}

#gearModal .modal-dialog {
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform: scale(0.95) translateY(10px);
  opacity: 0;
}

#gearModal.in .modal-dialog,
#gearModal.show .modal-dialog {
  transform: scale(1) translateY(0);
  opacity: 1;
}

#gearModal .modal-content {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(34, 9, 1, 0.3);
}

#videoGrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

#videoGrid iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
}

#gearTitle {
  font-size: 1.75rem;
  font-weight: 700;
  text-transform: uppercase;
  margin: 0 0 0.25rem 0;
}

#gearMeta {
  color: var(--rusty-spice);
  margin-bottom: 1rem;
}

#gearDescription {
  line-height: 1.7;
  color: var(--default-color);
  margin-bottom: 1rem;
}

#bigImage {
  text-align: center;
  margin: 0 0 1rem 0;
}

#bigImage img {
  max-width: 100%;
  height: auto;
}

@media (max-width: 767px) {
  #gearTitle {
    font-size: 1.35rem;
  }
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  padding: 0.5em 1em;
  background: var(--rusty-spice);
  color: #fff;
  text-decoration: none;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  left: 0;
}

@media (min-width: 768px) {
  .scrolling-column {
    overflow-y: auto !important;
  }
  .popover {
    max-width: 50% !important;
  }
}

@media (max-width: 767px) {
  .popover {
    max-width: 260px !important;
    font-size: 13px;
  }
  .popover h3 {
    font-size: 1em !important;
    margin-bottom: 0.25em;
  }
  .popover .mt-2 {
    margin-top: 0.35rem !important;
    line-height: 1.4;
  }
  #gearModal .modal-dialog {
    width: 95% !important;
    margin: 10px auto;
  }
  #gearModal .modal-content {
    border-radius: 12px;
  }
  #gearModal #bigImage img {
    width: 80% !important;
  }
}

.popover-more-btn {
  display: inline-block;
  background: var(--rusty-spice);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
  transition: background 0.2s ease;
}

.popover-more-btn:hover {
  background: var(--orange);
  color: var(--coffee-bean);
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .badge-pill,
  .popover,
  #gearModal .modal-dialog {
    animation: none !important;
    transition: none !important;
  }
  .card:hover,
  .card:hover .card-text img,
  .badge-pill:hover,
  .badge-pill:active {
    transform: none !important;
  }
}
