/* App Global & Common Component Styles */
:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --bulma-primary-h: 175deg;
  --bulma-primary-s: 84%;
  --bulma-primary-l: 26%;
}

.has-text-primary, a.has-text-primary {
  color: #0f766e !important;
}

.has-text-success {
  color: #15803d !important;
}

.has-text-grey {
  color: #475569 !important;
}

.has-text-grey-light {
  color: #64748b !important;
}

.tag.is-light {
  color: #1e293b !important;
}

.button.is-primary.is-outlined {
  color: #0f766e !important;
  border-color: #0f766e !important;
}

.button.is-primary.is-outlined:hover {
  background-color: #0f766e !important;
  color: #ffffff !important;
}

form:tool-form-active {
  outline: 2px dashed #2563eb;
  outline-offset: 2px;
}

button:tool-submit-active, input[type="submit"]:tool-submit-active {
  outline: 2px dashed #dc2626;
  outline-offset: 2px;
}

/* Favorites System Button */
.favorite-toggle-btn {
  position: relative;
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  z-index: 5;
}

.favorite-toggle-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 44px;
  min-height: 44px;
  width: 100%;
  height: 100%;
}

.favorite-toggle-btn:hover {
  transform: scale(1.1);
  background: rgba(15, 23, 42, 0.85);
}

.favorite-toggle-btn.is-favorited {
  background: #ffffff !important;
  color: #ef4444 !important;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #f8fafc;
  color: #1e293b;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.item-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: #ffffff;
}

.item-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

.category-scroll {
  display: flex;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 8px;
  padding-bottom: 4px;
}

.category-scroll::-webkit-scrollbar {
  display: none;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #334155;
  text-decoration: none;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.category-pill:hover, .category-pill.is-active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.category-pill .tag {
  background-color: #f1f5f9;
  color: #0f172a;
  font-weight: 600;
  transition: all 0.15s ease;
}

.category-pill:hover .tag, .category-pill.is-active .tag {
  background-color: #1d4ed8;
  color: #ffffff;
}

.hero-search-box {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-radius: 16px;
  color: #ffffff;
}

.stat-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.fa-icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.125em;
}

.fa-icon.fa-lg { width: 1.25em; height: 1.25em; }
.fa-icon.fa-2x { width: 2em; height: 2em; }
.fa-icon.fa-3x { width: 3em; height: 3em; }

.pswp__img {
  object-fit: contain;
  max-width: none !important;
}

.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #ffffff;
  border: none;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.15s ease;
  opacity: 0.85;
  padding: 0;
}

.slider-arrow:hover {
  background: rgba(15, 23, 42, 0.85);
  transform: translateY(-50%) scale(1.1);
  opacity: 1;
}

.slider-arrow-prev {
  left: 8px;
}

.slider-arrow-next {
  right: 8px;
}

.slider-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  z-index: 5;
  pointer-events: none;
}

.main-image-wrapper img {
  transition: filter 0.15s ease, opacity 0.15s ease;
}

.main-image-wrapper img.is-preview-loading {
  filter: blur(2px);
  opacity: 0.92;
}

.main-gallery-spinner {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 32px;
  height: 32px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 10;
}

.main-gallery-spinner .spinner-icon {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: gallery-spin 0.6s linear infinite;
}

@keyframes gallery-spin {
  to { transform: rotate(360deg); }
}

dialog:modal {
  overscroll-behavior: contain;
}

dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}

.feedback-fab-btn {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 970;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 9999px;
  background: #334155;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.feedback-fab-btn:hover {
  background: #1e293b;
  transform: translateY(-2px);
}

.item-sticky-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 980;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
}

.feedback-dialog {
  border: none;
  border-radius: 16px;
  padding: 0;
  max-width: 480px;
  width: calc(100vw - 24px);
  margin: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  background: #ffffff;
  color: #1e293b;
}

.feedback-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
}

.feedback-dialog-body {
  padding: 18px 20px;
}

.feedback-screenshot-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
}

.feedback-screenshot-preview {
  display: block;
  width: 100%;
  max-height: 140px;
  object-fit: cover;
  object-position: top center;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}

.feedback-captcha-box {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 14px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.feedback-captcha-box.is-verified {
  background: #f0fdf4;
  border-color: #22c55e;
}

.feedback-captcha-checkbox {
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
  cursor: pointer;
}

@media screen and (max-width: 768px) {
  .feedback-fab-btn {
    right: 12px;
    bottom: 12px;
    padding: 6px 10px;
    font-size: 0.75rem;
  }
  .feedback-fab-label {
    display: inline-block;
  }
  body.has-sticky-bottom-bar .feedback-fab-btn {
    bottom: 64px;
  }
  body.has-sticky-bottom-bar {
    padding-bottom: 56px;
  }
  html, body {
    overflow-x: hidden;
    width: 100%;
  }
  .container {
    max-width: 100vw;
    box-sizing: border-box;
  }
  .columns {
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-inline-start: 0 !important;
    margin-inline-end: 0 !important;
  }
  .button.is-fullwidth {
    white-space: normal !important;
    height: auto !important;
  }
  svg {
    max-width: 100%;
  }
}
