/*
 * components.css — in7.ba v2 Design System
 * Globalne komponente: buttons, badges, cards, section headers, gridi.
 * Importuje se u header.php nakon tokens.css.
 */

/* ─── RESET ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

/* ─── TIPOGRAFIJA ─────────────────────────────────────────── */
.text-display-xl {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(48px, 7vw, 92px);
  line-height: 1.0;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.text-display-lg {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(30px, 4.5vw, 58px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.text-display-md {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.15;
  color: var(--text-primary);
}

.text-label {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
}

/* ─── BUTTONS ─────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-accent);
  color: var(--text-on-accent);
  border: none;
  padding: 11px 22px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition-base);
  white-space: nowrap;
}
.btn-primary:hover {
  background: var(--color-accent-hover);
  color: var(--text-on-accent);
  text-decoration: none;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--color-accent);
  border: 1px solid var(--color-accent-border);
  padding: 11px 22px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition-base), border-color var(--transition-base);
  white-space: nowrap;
}
.btn-ghost:hover {
  background: var(--color-accent-light);
  border-color: var(--color-accent);
  color: var(--color-accent);
  text-decoration: none;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color var(--transition-base), color var(--transition-base);
}
.btn-icon:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* ─── BADGES / TAGOVI ─────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-body);
  line-height: 1;
}

.badge-featured {
  background: rgba(200, 145, 63, 0.15);
  border: 1px solid rgba(200, 145, 63, 0.35);
  color: var(--color-accent);
}

.badge-verified {
  background: rgba(76, 175, 125, 0.15);
  border: 1px solid rgba(76, 175, 125, 0.35);
  color: var(--color-verified);
}

.badge-rent {
  background: rgba(96, 165, 250, 0.15);
  border: 1px solid rgba(96, 165, 250, 0.35);
  color: var(--color-rent);
}

.badge-sale {
  background: rgba(249, 115, 22, 0.15);
  border: 1px solid rgba(249, 115, 22, 0.35);
  color: var(--color-sale);
}

.badge-live {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.30);
  color: var(--color-live);
}

/* ─── TRUST BADGE TIERS (L-02) ───────────────────────────── */
.badge-trust-verified {
  background: rgba(76, 175, 125, 0.15);
  border: 1px solid rgba(76, 175, 125, 0.35);
  color: var(--color-verified, #2d9a6d);
}
.badge-trust-premium {
  background: rgba(200, 145, 63, 0.15);
  border: 1px solid rgba(200, 145, 63, 0.35);
  color: var(--color-accent, #c8913f);
}
.badge-trust-active {
  background: rgba(96, 165, 250, 0.13);
  border: 1px solid rgba(96, 165, 250, 0.30);
  color: var(--color-rent, #3b82f6);
}

/* ─── SECTION HEADER ──────────────────────────────────────── */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 40px;
  gap: 24px;
}

.section-header-left { flex: 1; }

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(200, 145, 63, 0.12);
  border: 1px solid rgba(200, 145, 63, 0.22);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 14px;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(28px, 4vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin: 0 0 10px;
}

.section-subtitle {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0;
  line-height: 1.6;
}

.section-link {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--color-accent);
  text-decoration: none;
  white-space: nowrap;
  font-weight: 500;
  transition: opacity var(--transition-fast);
}
.section-link:hover {
  text-decoration: underline;
  color: var(--color-accent);
}

/* ─── LISTING / BUSINESS CARDS ────────────────────────────── */
.listing-card,
.business-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.listing-card:hover,
.business-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
  color: inherit;
  text-decoration: none;
}

.card-image-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  flex-shrink: 0;
}

.card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}

.listing-card:hover .card-image-wrap img,
.business-card:hover .card-image-wrap img {
  transform: scale(1.04);
}

.card-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.card-views {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
}

.card-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-category {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 6px;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  font-family: var(--font-body);
  gap: 8px;
}

.card-agent { font-weight: 500; }
.card-location { color: var(--text-muted); font-size: 12px; }

.card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--text-primary);
  margin: 0 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}

.card-desc {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
  flex: 1;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.card-price {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  color: var(--color-accent);
}

.card-action {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-base);
}
.card-action:hover { color: var(--color-accent); }

/* Business card profile button */
.card-profile-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 10px 16px;
  border: 1px solid var(--color-accent-border);
  border-radius: var(--radius-md);
  color: var(--color-accent);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--transition-base), border-color var(--transition-base);
  margin-top: auto;
}
.card-profile-btn:hover {
  background: var(--color-accent-light);
  border-color: var(--color-accent);
  color: var(--color-accent);
  text-decoration: none;
}

/* ─── GRIDI ───────────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--card-gap);
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ─── FEATURE CARD (Zašto IN7) ────────────────────────────── */
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}

.feature-card:hover {
  border-color: rgba(200,145,63,.35);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,0,0,.08);
}

.feature-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  font-size: 20px;
}

.feature-card-title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  color: var(--text-primary);
  margin: 0 0 8px;
}

.feature-card-desc {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.6;
}

/* ─── LAYOUT UTILITIES ────────────────────────────────────── */
.container-in7 {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 48px);
}

.section-in7 {
  padding: var(--section-padding-y) 0;
}

/* ─── LIVE DOT ────────────────────────────────────────────── */
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  70%  { box-shadow: 0 0 0 7px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-live);
  animation: livePulse 1.8s infinite;
  flex-shrink: 0;
}

/* ─── HERO ANIMACIJA ──────────────────────────────────────── */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.anim-fade-up {
  animation: fadeSlideUp 0.6s ease both;
}
.anim-delay-1 { animation-delay: 150ms; }
.anim-delay-2 { animation-delay: 300ms; }
.anim-delay-3 { animation-delay: 450ms; }

/* ─── SKELETON LOADING ────────────────────────────────────── */
/*
 * Dark/light-theme-aware skeleton shimmer.
 * Uses CSS vars so it works in both modes without JS.
 * Usage: <div class="skel skel--text"></div>
 *        <div class="skel skel--card"></div>
 *        <div class="skel skel--circle"></div>
 */

@keyframes skel-shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}

.skel {
  display: block;
  border-radius: var(--radius-md);
  animation: skel-shimmer 1.5s ease-in-out infinite;
  /* gradient shifts between bg-card and a slightly lighter tint */
  background: linear-gradient(
    90deg,
    var(--border-subtle) 0%,
    var(--border-default) 40%,
    var(--border-subtle) 80%
  );
  background-size: 1200px 100%;
}

.skel--text {
  height: 14px;
  width: 100%;
  border-radius: var(--radius-sm);
}

.skel--text-sm {
  height: 11px;
  width: 60%;
  border-radius: var(--radius-sm);
}

.skel--heading {
  height: 22px;
  width: 70%;
  border-radius: var(--radius-sm);
}

.skel--card {
  border-radius: var(--radius-lg);
  aspect-ratio: 4 / 3;
  width: 100%;
}

.skel--card-tall {
  border-radius: var(--radius-lg);
  aspect-ratio: 3 / 4;
  width: 100%;
}

.skel--circle {
  border-radius: var(--radius-full);
  aspect-ratio: 1;
}

.skel--line {
  height: 1px;
  width: 100%;
  border-radius: 0;
}

/* Pre-built card skeleton layout */
.skel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.skel-card__image   { height: 200px; }
.skel-card__body    { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.skel-card__title   { height: 18px; width: 75%; }
.skel-card__sub     { height: 13px; width: 50%; }
.skel-card__price   { height: 16px; width: 40%; margin-top: 4px; }

/* ─── HOVER UTILITIES ─────────────────────────────────────── */
.hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}

.hover-lift-sm {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.hover-lift-sm:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.hover-scale {
  transition: transform var(--transition-base);
}
.hover-scale:hover {
  transform: scale(1.03);
}

.hover-scale-sm {
  transition: transform var(--transition-base);
}
.hover-scale-sm:hover {
  transform: scale(1.015);
}

.hover-glow {
  transition: box-shadow var(--transition-base);
}
.hover-glow:hover {
  box-shadow: 0 0 0 3px var(--color-accent-border), var(--shadow-card-hover);
}

.hover-accent {
  transition: color var(--transition-fast), border-color var(--transition-fast);
}
.hover-accent:hover {
  color: var(--color-accent);
  border-color: var(--color-accent-border);
  text-decoration: none;
}

/* ─── OVERLAY / BACKDROP ──────────────────────────────────── */
.in7-backdrop {
  position: fixed;
  inset: 0;
  background: var(--bg-backdrop);
  z-index: var(--z-overlay);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.in7-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* ─── STATUS BADGE VARIANTS ───────────────────────────────── */
.badge-info {
  background: var(--color-info-bg, rgba(59, 130, 246, 0.12));
  border: 1px solid rgba(59, 130, 246, 0.30);
  color: var(--color-info);
}

.badge-success {
  background: var(--color-success-bg, rgba(2, 122, 72, 0.10));
  border: 1px solid rgba(76, 175, 125, 0.30);
  color: var(--color-success);
}

.badge-warning {
  background: var(--color-warning-bg, rgba(181, 71, 8, 0.10));
  border: 1px solid rgba(181, 71, 8, 0.28);
  color: var(--color-warning);
}

.badge-danger {
  background: var(--color-danger-bg, rgba(180, 35, 24, 0.10));
  border: 1px solid rgba(180, 35, 24, 0.28);
  color: var(--color-danger);
}

/* ─── MICROINTERACTION HELPERS ────────────────────────────── */

/* Fade-in on mount */
@keyframes in7-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Slide up on mount */
@keyframes in7-slide-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Slide down (for dropdowns) */
@keyframes in7-slide-down {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Scale in (for modals, popovers) */
@keyframes in7-scale-in {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

.anim-fade-in   { animation: in7-fade-in   var(--transition-base) ease both; }
.anim-slide-up  { animation: in7-slide-up  var(--transition-base) ease both; }
.anim-slide-down { animation: in7-slide-down var(--transition-base) ease both; }
.anim-scale-in  { animation: in7-scale-in  var(--transition-base) ease both; }

.anim-delay-100 { animation-delay: 100ms; }
.anim-delay-150 { animation-delay: 150ms; }
.anim-delay-200 { animation-delay: 200ms; }
.anim-delay-300 { animation-delay: 300ms; }
.anim-delay-400 { animation-delay: 400ms; }
.anim-delay-500 { animation-delay: 500ms; }

/* ─── FOCUS RING UTILITY ──────────────────────────────────── */
/*
 * Consistent focus ring for keyboard navigation.
 * Apply .focus-ring to any interactive element.
 */
.focus-ring:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ─── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 991px) {
  .features-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 28px;
  }
  .features-grid  { grid-template-columns: 1fr; }
  .cards-grid     { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}

@media (max-width: 480px) {
  .cards-grid     { grid-template-columns: 1fr; }
}
