/* ============================================
   ANIMATIONS.CSS - Scroll reveal + micro-animations
   ============================================ */

/* ---------- SCROLL REVEAL ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }
.reveal-delay-5 { transition-delay: 0.40s; }

.reveal-left {
  opacity: 0;
  transform: translateX(-32px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-left.reveal-visible { opacity: 1; transform: translateX(0); }

.reveal-right {
  opacity: 0;
  transform: translateX(32px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-right.reveal-visible { opacity: 1; transform: translateX(0); }

.reveal-scale {
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-scale.reveal-visible { opacity: 1; transform: scale(1); }

/* ---------- GRADIENT ORBS HERO ---------- */
@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(40px, -30px) scale(1.08); }
  66%       { transform: translate(-20px, 20px) scale(0.95); }
}
@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(-50px, 30px) scale(0.92); }
  66%       { transform: translate(30px, -40px) scale(1.1); }
}
@keyframes orbFloat3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%       { transform: translate(20px, 40px) scale(1.05); }
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  pointer-events: none;
  will-change: transform;
}
.orb-1 {
  width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(201, 160, 74, 0.22) 0%, transparent 70%);
  top: -120px; left: -80px;
  animation: orbFloat1 14s ease-in-out infinite;
}
.orb-2 {
  width: 440px; height: 440px;
  background: radial-gradient(circle, rgba(62, 107, 140, 0.28) 0%, transparent 70%);
  bottom: -60px; right: 10%;
  animation: orbFloat2 18s ease-in-out infinite;
}
.orb-3 {
  width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(198, 107, 61, 0.18) 0%, transparent 70%);
  top: 30%; right: 25%;
  animation: orbFloat3 22s ease-in-out infinite;
}

/* ---------- NAVBAR SCROLL TRANSFORM ---------- */
.navbar {
  transition: padding 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}
.navbar.nav-scrolled {
  box-shadow: 0 2px 20px rgba(15, 27, 45, 0.1);
  background: rgba(255, 255, 255, 0.98);
}

/* ---------- CARD HOVER ENHANCEMENTS ---------- */
.prop-card .prop-card-img img,
.prop-card .prop-card-img .img-placeholder {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.prop-card:hover .prop-card-img img,
.prop-card:hover .prop-card-img .img-placeholder {
  transform: scale(1.06);
}

/* Quick stats overlay on card hover */
.prop-card .card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(15, 27, 45, 0.75) 100%);
  opacity: 0;
  transition: opacity 0.35s ease;
  display: flex;
  align-items: flex-end;
  padding: 16px;
  z-index: 3;
}
.prop-card:hover .card-overlay { opacity: 1; }
.prop-card .card-overlay-content {
  color: var(--white);
  font-size: 13px;
  display: flex;
  gap: 12px;
  font-weight: 500;
}
.prop-card .card-overlay-content span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ---------- PROJECT CARD ---------- */
.project-card .project-card-img img,
.project-card .project-card-img .img-placeholder {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.project-card:hover .project-card-img img,
.project-card:hover .project-card-img .img-placeholder {
  transform: scale(1.05);
}

/* ---------- BUTTON PULSE ---------- */
.btn-gold {
  position: relative;
  overflow: hidden;
}
.btn-gold::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  transition: background 0.2s ease;
}
.btn-gold:hover::after {
  background: rgba(255, 255, 255, 0.12);
}

/* ---------- BADGE ANIMATE ---------- */
@keyframes badgePop {
  0%   { transform: scale(0.8); opacity: 0; }
  70%  { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}
.badge { animation: badgePop 0.3s ease forwards; }

/* ---------- PRICE COUNTER ANIMATE ---------- */
@keyframes priceSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.prop-card-price { animation: priceSlideIn 0.4s ease 0.1s both; }

/* ---------- SKELETON LOADING ---------- */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-50) 50%, var(--gray-100) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: var(--r-sm);
}

/* ---------- STATS COUNT ANIMATE ---------- */
@keyframes countPulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}
.stat-num.counting { animation: countPulse 0.15s ease; }

/* ---------- FLUX TAB INDICATOR ---------- */
.flux-tab { position: relative; overflow: hidden; }
.flux-tab::before {
  content: "";
  position: absolute;
  bottom: 0; left: 50%;
  width: 0; height: 3px;
  transform: translateX(-50%);
  transition: width 0.3s ease;
}
.flux-tab.active[data-flux="rezidential"]::before { background: var(--accent-rezidential); width: 100%; }
.flux-tab.active[data-flux="comercial"]::before   { background: var(--accent-comercial); width: 100%; }
.flux-tab.active[data-flux="terenuri"]::before    { background: var(--accent-terenuri); width: 100%; }
.flux-tab.active[data-flux="proiecte"]::before    { background: var(--accent-proiecte); width: 100%; }

/* ---------- FLOATING LABEL INPUTS ---------- */
.float-label {
  position: relative;
}
.float-label input,
.float-label select {
  padding-top: 20px;
  padding-bottom: 6px;
}
.float-label label {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--gray-400);
  pointer-events: none;
  transition: all 0.2s ease;
  margin: 0;
}
.float-label input:focus + label,
.float-label input:not(:placeholder-shown) + label,
.float-label select:focus + label,
.float-label select:not([value=""]) + label {
  top: 10px;
  transform: translateY(0);
  font-size: 11px;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- PAGE TRANSITION ---------- */
@keyframes pageIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-body {
  animation: pageIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ---------- PILL HOVER RIPPLE ---------- */
.pill {
  position: relative;
  overflow: hidden;
}
.pill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--navy);
  border-radius: inherit;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.2s, transform 0.2s;
}
.pill.active::after { opacity: 1; transform: scale(1); }
.pill span { position: relative; z-index: 1; }

/* ---------- SECTION DIVIDER ---------- */
.section-divider {
  width: 56px;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), transparent);
  margin: 12px auto 0;
  border-radius: 2px;
}

/* ---------- CARD PRICE PULSE (new listing) ---------- */
.prop-card.is-new .prop-card-price::before {
  content: "NOU";
  display: inline-block;
  background: var(--gold);
  color: var(--navy);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: middle;
  letter-spacing: 0.05em;
}

/* ---------- TOOLTIP ---------- */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 10px;
  background: var(--navy);
  color: var(--white);
  font-size: 12px;
  border-radius: var(--r-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 10;
}
[data-tooltip]:hover::after { opacity: 1; }

/* ---------- PROGRESS BAR ---------- */
.progress-bar-wrap {
  background: var(--gray-100);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 4px;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1) 0.3s;
}
.reveal-visible .progress-bar-fill { transform: scaleX(1); }

/* ---------- STICKY PILL FILTER BAR ---------- */
.pill-bar {
  position: sticky;
  top: var(--nav-h);
  z-index: 50;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gray-100);
  padding: 12px 0;
}

/* ---------- GLASSMORPHISM CARD ---------- */
.glass-card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--r-lg);
}

/* ---------- FOCUS RING ---------- */
*:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .reveal-delay-1, .reveal-delay-2, .reveal-delay-3,
  .reveal-delay-4, .reveal-delay-5 {
    transition-delay: 0s;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
