/* Custom styles for motorcycle rental platform */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  word-break: keep-all;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Card hover effects */
.motorcycle-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.motorcycle-card:hover {
  transform: translateY(-4px);
  border-color: #bfdbfe;
  box-shadow: 0 14px 20px -12px rgb(0 0 0 / 0.18);
}

/* Image aspect ratio */
.motorcycle-image {
  aspect-ratio: 16/9;
  object-fit: contain;
  background: #fff;
}

/* Badge styles */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
}

/* Admin mode indicators */
.admin-edit-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(251, 191, 36, 0.9);
  color: #1f2937;
  padding: 0.5rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 10;
}

.admin-edit-btn:hover {
  background: rgba(251, 191, 36, 1);
  transform: scale(1.05);
}

/* Toast notification animations */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(400px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast-notification {
  animation: slideIn 0.3s ease-out;
  transition: opacity 0.3s, transform 0.3s;
}

.animate-slide-in {
  animation: slideIn 0.3s ease-out;
}

/* Loading animation */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.fa-spin {
  animation: spin 1s linear infinite;
}

/* View Switcher active state */
.mode-btn.active {
  background: #3b82f6 !important;
  color: white !important;
  font-weight: 600;
}

/* Primary buttons - Force dark blue visibility */
button[id*="search-btn"],
button[id*="add-motorcycle-btn"],
button[id*="add-brand-btn"],
button[class*="search-btn"],
.btn-primary,
.bg-primary {
  background-color: #23545B !important;
  color: #FFFFFF !important;
  border: none !important;
}

button[id*="search-btn"]:hover,
button[id*="add-motorcycle-btn"]:hover,
button[id*="add-brand-btn"]:hover,
button[class*="search-btn"]:hover,
.btn-primary:hover {
  background-color: #1c444a !important;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2) !important;
}

/* Ensure button text is always white */
button[id*="search-btn"] *,
button[id*="add-motorcycle-btn"] *,
button[id*="add-brand-btn"] *,
.btn-primary * {
  color: #FFFFFF !important;
}

/* Admin table image hover zoom effect */
.admin-table-image-wrapper {
  position: relative;
  width: 80px;
  height: 80px;
  overflow: hidden;
  border-radius: 0.5rem;
  cursor: pointer;
}

.admin-table-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.admin-table-image-wrapper:hover img {
  transform: scale(2.5);
  z-index: 50;
}

/* Development view switcher */
.view-switcher {
  max-width: min(18rem, calc(100vw - 2rem));
}

.view-switcher-toggle {
  min-height: 2.25rem;
}

.view-switcher-panel {
  width: 9.5rem;
}

.view-switcher .fa-chevron-down {
  transition: transform 0.2s ease;
}

.view-switcher .fa-chevron-down.rotate-180 {
  transform: rotate(180deg);
}

@media (max-width: 768px) {
  #view-switcher {
    top: auto;
    bottom: 1rem;
    right: 1rem;
    left: auto;
  }

  .view-switcher-panel {
    width: min(20rem, calc(100vw - 2rem));
  }

  .view-switcher-panel .flex {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .view-switcher-panel .mode-btn {
    min-height: 3rem;
    padding-inline: 0.4rem;
    font-size: 0.8rem;
  }
}

.rider-hero-image {
  object-position: 68% center;
}

.hero-title {
  word-break: keep-all;
}

.keep-word {
  word-break: keep-all;
  overflow-wrap: break-word;
}

@media (max-width: 640px) {
  .rider-hero-image {
    object-position: 62% center;
  }

  h1,
  h2,
  h3,
  h4,
  p,
  summary,
  li,
  a,
  button,
  .rider-badge,
  .brand-tab,
  .rider-tab {
    word-break: keep-all;
    overflow-wrap: break-word;
  }

  #banner-container {
    height: 520px;
  }

  #banner-container .container {
    padding-right: 1rem;
  }

  #banner-container .hero-title {
    max-width: 18rem;
    font-size: 2rem;
    line-height: 1.18;
  }

  #banner-container p {
    max-width: 20rem;
    line-height: 1.55;
  }

  #rider-fit h2,
  #vehicles + section h2,
  #process h2,
  #process h3 {
    line-height: 1.25;
  }

  #rider-fit p,
  #vehicles p,
  #process p,
  footer p {
    line-height: 1.7;
  }

  #vehicles + section h2 {
    font-size: 1.65rem;
  }

  .motorcycle-card-title {
    min-height: 0 !important;
    font-size: 1.08rem;
    line-height: 1.35;
  }

  .motorcycle-card .grid.grid-cols-3 p {
    line-height: 1.25;
  }

  .motorcycle-card .grid.grid-cols-3 p:last-child {
    font-size: 0.86rem;
  }

  footer {
    word-break: keep-all;
  }
}

/* Brand Tabs - Mobile First Design */
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

.brand-tab,
.rider-tab {
  white-space: nowrap;
  min-width: fit-content;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 9999px;
  border: 2px solid #e5e7eb;
  background: white;
  color: #374151;
  transition: all 0.2s ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.brand-tab:hover,
.rider-tab:hover {
  border-color: #3b82f6;
  background: #eff6ff;
  transform: translateY(-1px);
}

.brand-tab:active,
.rider-tab:active {
  transform: translateY(0);
}

.brand-tab.active,
.rider-tab.active {
  background: #23545B;
  color: white;
  border-color: #23545B;
  font-weight: 600;
  box-shadow: 0 4px 6px -1px rgba(0, 51, 102, 0.3);
}

.rider-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.brand-tab .count,
.rider-tab .count {
  display: inline-block;
  margin-left: 0.375rem;
  padding: 0.125rem 0.5rem;
  background: #e5e7eb;
  color: #4b5563;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.rider-tab .count {
  margin-left: 0;
}

.brand-tab.active .count,
.rider-tab.active .count {
  background: rgba(255, 255, 255, 0.3);
  color: white;
}

.rider-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-height: 1.6rem;
}

.rider-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.5rem;
  padding: 0.2rem 0.55rem;
  border-radius: 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.rider-badge-stock {
  background: #ecfdf5;
  color: #047857;
}

.rider-badge-entry {
  background: #eff6ff;
  color: #1d4ed8;
}

.rider-badge-box {
  background: #fff7ed;
  color: #c2410c;
}

.rider-badge-long {
  background: #f5f3ff;
  color: #6d28d9;
}

.rider-badge-neutral {
  background: #f3f4f6;
  color: #4b5563;
}

/* Touch-friendly spacing */
@media (max-width: 768px) {
  .brand-tab,
  .rider-tab {
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
  }
}

/* ═══ 따로 짠 긴 창 — 화면 안에 맞추기 (공용 · 승인 A-1001-07·09, 2026-10-01) ═══════════════
   오너 원문: "모델추가할때마다 팝업 세로길이가 너무길어져서 내가 버튼을 못누를정도" → 1안 · "11곳도 같은 방식으로"
   창 판에 modal-fit, 가운데 내용에 modal-fit-body, 제목·단추 줄에 modal-fit-fixed 를 붙인다.
   ⇒ 창 높이는 화면의 90% 안, 제목·단추 줄은 늘 보이고, 가운데만 스크롤한다. ⛔창마다 사본을 만들지 않는다 — 여기 한 곳.
   (form 이 판과 몸통 사이에 끼면 그 form 에 modal-fit-form 을 붙인다 — 높이를 몸통까지 넘겨 준다) */
.modal-fit { max-height: 90vh; display: flex; flex-direction: column; }
.modal-fit-form { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.modal-fit-body { overflow-y: auto; min-height: 0; flex: 1 1 auto; }
.modal-fit-fixed { flex-shrink: 0; }
