/* ============================================
   YRSF — Shared Custom Styles
   Supplements Tailwind CSS CDN
   ============================================ */

/* --- Base --- */
body {
  font-family: 'Montserrat', sans-serif;
}

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  display: inline-block;
  vertical-align: middle;
}

html {
  scroll-behavior: smooth;
}

::selection {
  background: #b5d0ff;
  color: #1a1c1c;
}

/* --- Glass Navigation --- */
.glass-nav {
  backdrop-filter: blur(8px);
  background-color: rgba(249, 249, 249, 0.8);
}

/* --- Hero Dot Pattern --- */
.hero-pattern {
  background-image: radial-gradient(circle at 2px 2px, #455f88 1px, transparent 0);
  background-size: 40px 40px;
  opacity: 0.05;
}

/* --- Navigation Shadow --- */
.nav-shadow {
  box-shadow: 0 4px 20px -5px rgba(0, 35, 73, 0.05);
}

/* --- Premium Border --- */
.premium-border {
  border: 1px solid rgba(69, 95, 136, 0.1);
}

/* --- Active Tab Underline --- */
.active-tab-link {
  border-bottom: 2px solid #455f88;
  color: #455f88;
  font-weight: 700;
}

/* --- Loading Skeleton --- */
.skeleton {
  background: linear-gradient(90deg, #e8e8e8 25%, #f3f3f4 50%, #e8e8e8 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 0.25rem;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- Image Lazy Load Fade-in --- */
.lazy-image {
  opacity: 0;
  transition: opacity 0.4s ease;
}

.lazy-image.loaded {
  opacity: 1;
}

/* --- Toast Notifications --- */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 20px;
  border-radius: 0.5rem;
  color: white;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  transform: translateX(120%);
  transition: transform 0.3s ease;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  pointer-events: auto;
}

.toast.show {
  transform: translateX(0);
}

.toast.success {
  background-color: #16a34a;
}

.toast.error {
  background-color: #ba1a1a;
}

.toast.info {
  background-color: #455f88;
}

/* --- Modal / Dialog Overlay --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: white;
  border-radius: 0.75rem;
  max-width: 90vw;
  max-height: 90vh;
  overflow: auto;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

/* --- Lightbox --- */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-overlay img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 0.5rem;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  font-size: 24px;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-nav.prev {
  left: 20px;
}

.lightbox-nav.next {
  right: 20px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 28px;
  padding: 8px;
}

.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.8);
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
}

/* --- Favorite Heart Animation --- */
.favorite-btn .material-symbols-outlined {
  transition: transform 0.2s ease, color 0.2s ease;
}

.favorite-btn.active .material-symbols-outlined {
  font-variation-settings: 'FILL' 1;
  color: #ba1a1a;
  transform: scale(1.2);
}

.favorite-btn:hover .material-symbols-outlined {
  transform: scale(1.1);
}

/* --- Mobile Nav Menu --- */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: rgba(249, 249, 249, 0.98);
  z-index: 100;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  padding: 80px 24px 24px;
  gap: 8px;
}

.mobile-menu.open {
  transform: translateX(0);
}

.mobile-menu-close {
  position: absolute;
  top: 20px;
  right: 20px;
}

.mobile-menu-toggle {
  display: none;
}

@media (max-width: 767px) {
  .mobile-menu-toggle {
    display: flex;
  }
}

/* --- Filter Select Arrow --- */
.filter-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23444748' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* --- Card Hover Lift --- */
.card-hover {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

/* --- Scroll Fade-in Animation --- */
.fade-in-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Line Clamp --- */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Focus Styles for Accessibility --- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #455f88;
  outline-offset: 2px;
  border-radius: 0.25rem;
}

/* --- Placeholder SVG for lazy images --- */
img[data-src] {
  background-color: #e8e8e8;
}

/* --- Scrollbar & Hero Gradient --- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #fbfbe2; }
::-webkit-scrollbar-thumb { background: #adc8f6; border-radius: 10px; }
.hero-gradient { background: linear-gradient(to right, rgba(251, 251, 226, 0.9) 0%, rgba(251, 251, 226, 0.5) 50%, transparent 100%); }

/* --- Prevent iOS Safari screen zoom on mobile dropdowns/inputs --- */
@media screen and (max-width: 1024px) {
  select, input[type="text"], input[type="search"], input[type="number"], input[type="date"], input[type="email"], input[type="tel"], textarea {
    font-size: 16px !important;
  }
}
