/* ==========================================================================
   szukamymieszkania.pl - Modern Luxury & High-Converting Design System
   Paleta: Royal Indigo (#4F46E5), Electric Ultramarine (#2563EB), 
           Sunset Coral (#FF5A5F), Emerald Mint (#10B981), Obsidian Night (#090D1A)
   ========================================================================== */

:root {
  /* Primary & Brand Colors */
  --color-primary: #090d1a;
  --color-primary-light: #1e293b;
  --color-primary-dark: #050811;
  
  /* Vibrant Electric Accents */
  --color-accent: #4f46e5;
  --color-accent-hover: #4338ca;
  --color-accent-light: #eef2ff;
  --color-accent-blue: #2563eb;
  --color-accent-cyan: #06b6d4;
  --color-accent-emerald: #10b981;
  --color-accent-coral: #ff5a5f;

  /* Secondary & Highlights */
  --color-amber: #f59e0b;
  --color-amber-light: #fef3c7;
  --color-rose: #f43f5e;

  /* Surfaces & Backgrounds */
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-surface-subtle: #f1f5f9;
  --color-surface-elevated: #ffffff;
  
  /* Text & Borders */
  --color-text-main: #0f172a;
  --color-text-muted: #64748b;
  --color-text-light: #94a3b8;
  --color-border: #e2e8f0;
  --color-border-subtle: #f1f5f9;
  --color-border-focus: #4f46e5;

  /* Status Colors */
  --color-success: #10b981;
  --color-success-bg: #ecfdf5;
  --color-warning: #f59e0b;
  --color-warning-bg: #fffbeb;
  --color-danger: #ef4444;
  --color-danger-bg: #fef2f2;
  --color-info: #3b82f6;
  --color-info-bg: #eff6ff;

  /* Glowing Modern Shadows */
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -2px rgba(79, 70, 229, 0.04);
  --shadow-lg: 0 12px 24px -4px rgba(15, 23, 42, 0.08), 0 4px 12px -4px rgba(79, 70, 229, 0.06);
  --shadow-xl: 0 20px 32px -6px rgba(15, 23, 42, 0.12), 0 8px 16px -6px rgba(79, 70, 229, 0.08);
  --shadow-glow-indigo: 0 0 25px rgba(79, 70, 229, 0.35);
  --shadow-glow-coral: 0 0 25px rgba(255, 90, 95, 0.35);
  --shadow-glow-emerald: 0 0 25px rgba(16, 185, 129, 0.35);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Strict Mobile Overflow Lockdown & Responsive Ergonomics */
html {
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100vw !important;
  box-sizing: border-box;
  -webkit-text-size-adjust: 100%;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100vw !important;
  position: relative;
  margin: 0;
  padding: 0;
}

img, video, iframe, svg, canvas {
  max-width: 100%;
  height: auto;
}

.mobile-scroll-x {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: 'Hanken Grotesk', 'Outfit', system-ui, sans-serif;
  word-break: break-word;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #4f46e5;
}

/* Glassmorphism / Header styles */
.glass-header {
  background: #ffffff !important;
  background-color: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.glass-card {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.glass-dark {
  background: rgba(9, 13, 26, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Modern Card Hover Effects */
.property-card {
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), border-color var(--transition-smooth);
}
.property-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 35px -5px rgba(79, 70, 229, 0.12), 0 10px 18px -6px rgba(15, 23, 42, 0.08);
  border-color: rgba(79, 70, 229, 0.35);
}

.property-card .image-zoom {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.property-card:hover .image-zoom {
  transform: scale(1.06);
}

/* Vibrant Eye-Catching Gradients */
.gradient-primary {
  background: linear-gradient(135deg, #090d1a 0%, #1e1b4b 50%, #0f172a 100%);
}

.gradient-hero {
  background: linear-gradient(135deg, #090d1a 0%, #1e1b4b 45%, #312e81 80%, #4338ca 100%);
}

.gradient-cta {
  background: linear-gradient(135deg, #4f46e5 0%, #2563eb 50%, #06b6d4 100%);
}

.gradient-sunset {
  background: linear-gradient(135deg, #ff5a5f 0%, #f43f5e 50%, #fb923c 100%);
}

.gradient-emerald {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

.gradient-amber {
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
}

.gradient-subtle {
  background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
}

/* Badge Styles */
.badge-promoted {
  background: linear-gradient(135deg, #ff5a5f 0%, #f43f5e 100%);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(244, 63, 94, 0.4);
}

.badge-featured {
  background: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(79, 70, 229, 0.4);
}

.badge-vip {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(245, 158, 11, 0.4);
}

.badge-new {
  background: linear-gradient(135deg, #06b6d4 0%, #2563eb 100%);
  color: #ffffff;
}

/* Custom Checkbox & Radio */
input[type="checkbox"], input[type="radio"] {
  accent-color: var(--color-accent);
}

/* Interactive Map Pin */
.map-marker {
  transition: all var(--transition-fast);
  cursor: pointer;
}
.map-marker:hover, .map-marker.active {
  transform: scale(1.18) translateY(-3px);
  background-color: var(--color-accent);
  color: #ffffff;
  box-shadow: var(--shadow-glow-indigo);
  z-index: 30;
}

/* Range Slider */
input[type="range"] {
  accent-color: var(--color-accent);
}

/* Pulse animation for live indicators */
@keyframes live-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.7; }
}

.live-dot {
  animation: live-pulse 2s infinite ease-in-out;
}

/* Button micro-interactions */
.btn-hover-lift {
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), filter var(--transition-fast);
}
.btn-hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -2px rgba(79, 70, 229, 0.35);
  filter: brightness(1.05);
}
.btn-hover-lift:active {
  transform: translateY(0);
}

/* Tab active indicator */
.tab-active {
  color: var(--color-accent) !important;
  border-bottom: 2px solid var(--color-accent);
}

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

.toast {
  pointer-events: auto;
  min-width: 320px;
  max-width: 440px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: #ffffff;
  box-shadow: 0 20px 30px -5px rgba(15, 23, 42, 0.15), 0 0 15px rgba(79, 70, 229, 0.1);
  border-left: 4px solid var(--color-accent);
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  animation: slideInRight 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.25s, transform 0.25s;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

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

.toast-success { border-left-color: var(--color-success); }
.toast-error { border-left-color: var(--color-danger); }
.toast-info { border-left-color: var(--color-info); }

/* User Navbar Dropdown Hover Bridge */
.user-nav-dropdown {
  pointer-events: auto;
}

#user-profile-menu-container:hover .user-nav-dropdown,
.user-nav-dropdown:hover {
  display: block !important;
}

/* ==========================================================================
   📱 Mobile-First Luxury UI & App Ergonomics
   ========================================================================== */

/* Prevent iOS Safari auto-zoom on form inputs */
@media (max-width: 768px) {
  input, select, textarea {
    font-size: 16px !important;
  }
  
  body {
    padding-bottom: calc(env(safe-area-inset-bottom) + 72px) !important;
  }
}

/* Smooth Touch-Action Horizontal Scrolling (Categories, Filters) */
.mobile-scroll-x {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.mobile-scroll-x::-webkit-scrollbar {
  display: none;
}
.mobile-scroll-x > * {
  scroll-snap-align: start;
  flex-shrink: 0;
}

/* Mobile Bottom App Navigation Bar */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(226, 232, 240, 0.85);
  box-shadow: 0 -4px 20px -2px rgba(15, 23, 42, 0.08);
  padding: 6px 12px calc(env(safe-area-inset-bottom) + 6px) 12px;
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  padding: 4px 10px;
  border-radius: 12px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  text-decoration: none;
  min-width: 56px;
}

.mobile-nav-item:active {
  transform: scale(0.92);
}

.mobile-nav-item.active {
  color: #4f46e5;
}

.mobile-nav-item.active .material-symbols-outlined {
  font-variation-settings: 'FILL' 1, 'wght' 600;
  color: #4f46e5;
}

.mobile-nav-add-btn {
  background: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%);
  color: #ffffff !important;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
  margin-top: -12px;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.mobile-nav-add-btn:active {
  transform: scale(0.9);
}

/* Touch targets & PageSpeed Mobile Ergonomics */
button, a, input, select {
  touch-action: manipulation;
}

/* Ensure accessible minimum touch target area */
button, a.btn, .hero-type-btn, .featured-tab, .cms-status-tab {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* PageSpeed Font Display Swap & Anti-Layout Shift */
@supports (font-display: swap) {
  * {
    font-display: swap;
  }
}

/* Strict Layout-Shift prevention for Google Material Symbols icons */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined', sans-serif;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  display: inline-block;
  width: 1em;
  height: 1em;
  min-width: 1em;
  min-height: 1em;
  max-width: 1em;
  max-height: 1em;
  overflow: hidden;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  vertical-align: middle;
  line-height: 1;
  user-select: none;
  font-size-adjust: none;
}

/* Skeleton Loading Cards (CLS Reduction) */
.skeleton-card {
  min-height: 420px;
}

picture {
  display: inline-block;
}

/* Performance: reduce paint on animated/interactive elements */
.property-card,
[class*="hover:"] {
  will-change: auto;
}

