/* ─── Rent a Room — Style inspired by miete24.com ─── */
:root {
  --primary: #1a56db;
  --primary-hover: #1544b8;
  --primary-light: #e8eefb;
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --text: #1f2937;
  --text-secondary: #6b7280;
  --bg: #f3f4f6;
  --white: #ffffff;
  --border: #e5e7eb;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
  --transition: 0.2s ease;
  --font-scale: 1;
}

/* ── Dark Theme ── */
[data-theme="dark"] {
  --primary: #60a5fa;
  --primary-hover: #3b82f6;
  --primary-light: #1e3a5f;
  --text: #f3f4f6;
  --text-secondary: #9ca3af;
  --bg: #111827;
  --white: #1f2937;
  --border: #374151;
  --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.4);
}
[data-theme="dark"] .hero {
  background: linear-gradient(135deg, #1e3a5f 0%, #1e40af 50%, #3b82f6 100%);
}
[data-theme="dark"] .listing-card {
  background: #1f2937;
}
[data-theme="dark"] .listing-detail {
  background: #111827;
}
[data-theme="dark"] .listing-fav {
  background: rgba(0,0,0,0.6);
  color: #9ca3af;
}
[data-theme="dark"] .search-bar {
  background: #1f2937;
}
[data-theme="dark"] .search-bar input,
[data-theme="dark"] .search-bar select {
  background: #374151;
  color: #f3f4f6;
}
[data-theme="dark"] .filter-tag {
  background: #1f2937;
  color: #9ca3af;
  border-color: #4b5563;
}
[data-theme="dark"] .filter-tag.active {
  background: var(--primary);
  color: #111827;
}
[data-theme="dark"] .topnav {
  background: #1f2937;
}
[data-theme="dark"] .hamburger span {
  background: #f3f4f6;
}
[data-theme="dark"] .nav-overlay {
  background: rgba(0,0,0,0.6);
}
@media (max-width: 768px) {
  [data-theme="dark"] .topnav-links {
    background: #1f2937;
  }
}
[data-theme="dark"] .detail-features li {
  background: #1f2937;
  border-color: #4b5563;
}
[data-theme="dark"] .btn-phone {
  background: #374151 !important;
  color: #f3f4f6;
  border-color: #4b5563 !important;
}
[data-theme="dark"] .listing-tag {
  background: #374151;
  color: #9ca3af;
}
[data-theme="dark"] .footer {
  background: #0a0f1a;
}

/* ── Auto dark mode before JS loads ── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --primary: #60a5fa;
    --primary-hover: #3b82f6;
    --primary-light: #1e3a5f;
    --text: #f3f4f6;
    --text-secondary: #9ca3af;
    --bg: #111827;
    --white: #1f2937;
    --border: #374151;
    --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.4);
  }
}

/* ── Font Size Scales ── */
.font-normal { --font-scale: 1; }
.font-large { --font-scale: 1.2; }

body {
  font-size: calc(16px * var(--font-scale, 1));
}
.font-large .listing-title { font-size: calc(1.1rem * 1.2); }
.font-large .listing-price { font-size: calc(1.2rem * 1.2); }
.font-large .listing-desc { font-size: calc(0.9rem * 1.2); }
.font-large .hero h1 { font-size: calc(2.8rem * 1.15); }
.font-large .hero p { font-size: calc(1.2rem * 1.1); }
.font-large .section-heading h2 { font-size: calc(1.6rem * 1.15); }

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── Top Navigation ── */
.topnav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.topnav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.topnav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--primary);
  font-size: 1.4rem;
  font-weight: 800;
}
.topnav-brand span { color: var(--accent); }
.topnav-links {
  display: flex;
  gap: 8px;
  align-items: center;
}
.topnav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
}
.topnav-links a:hover { background: var(--primary-light); color: var(--primary); }
.topnav-links a.active { background: var(--primary); color: var(--white); }
.topnav-links .btn-post {
  background: var(--accent);
  color: var(--white);
  font-weight: 600;
  padding: 8px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}
.topnav-links .btn-post:hover { background: var(--accent-hover); }

/* ── Hero Section ── */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 50%, #60a5fa 100%);
  color: var(--white);
  padding: 80px 24px 60px;
  text-align: center;
}
.hero h1 { font-size: 2.8rem; font-weight: 800; margin-bottom: 12px; }
.hero p { font-size: 1.2rem; opacity: 0.9; max-width: 600px; margin: 0 auto 32px; }

/* ── Search Bar ── */
.search-bar {
  max-width: 700px;
  margin: -36px auto 0;
  position: relative;
  z-index: 10;
  background: var(--white);
  border-radius: 16px;
  padding: 8px;
  box-shadow: var(--shadow-lg);
  display: flex;
  gap: 8px;
}
.search-bar input {
  flex: 1;
  border: none;
  padding: 14px 20px;
  font-size: 1rem;
  border-radius: var(--radius);
  outline: none;
  background: var(--bg);
  color: var(--text);
}
.search-bar input::placeholder { color: var(--text-secondary); }
.search-bar select {
  border: none;
  padding: 14px 16px;
  font-size: 0.9rem;
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  outline: none;
  min-width: 120px;
}
.search-bar button {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.search-bar button:hover { background: var(--primary-hover); }

/* ── Container ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Section Headings ── */
.section-heading {
  margin: 48px 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-heading h2 { font-size: 1.6rem; font-weight: 700; }
.section-heading a {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

/* ── Filter Tags ── */
.filter-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.filter-tag {
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--white);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
  font-weight: 500;
}
.filter-tag:hover { border-color: var(--primary); color: var(--primary); }
.filter-tag.active { background: var(--primary); color: var(--white); border-color: var(--primary); }

/* ── Listings Grid ── */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

/* ── Listing Card ── */
.listing-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: box-shadow 0.25s ease, transform 0.15s ease;
  cursor: pointer;
}
.listing-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.listing-card-image {
  width: 100%;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.listing-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.listing-card-image:hover img {
  transform: scale(1.15);
}
/* Image carousel dots */
.img-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  z-index: 3;
}
.img-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.8);
  cursor: pointer;
  transition: var(--transition);
}
.img-dot.active {
  background: var(--white);
  transform: scale(1.2);
}
.img-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--text);
  z-index: 3;
  opacity: 0;
  transition: opacity 0.2s;
}
.listing-card-image:hover .img-nav {
  opacity: 1;
}
.img-nav:hover {
  background: var(--white);
}
.img-nav-prev { left: 8px; }
.img-nav-next { right: 44px; }
/* Touch devices: always show nav arrows */
@media (hover: none) and (pointer: coarse) {
  .img-nav {
    opacity: 0.85;
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }
  .listing-card-image .img-nav {
    opacity: 0.85;
  }
}
.listing-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}
.badge-new { background: #10b981; color: white; }
.badge-popular { background: var(--accent); color: white; }
.badge-reduced { background: #ef4444; color: white; }
.listing-fav {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.listing-fav:hover { background: var(--white); transform: scale(1.1); }
.listing-fav.active { background: #ef4444; color: white; }

.listing-body { padding: 20px; }
.listing-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.listing-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.listing-price {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
}
.listing-price small {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-secondary);
}
.listing-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 12px;
  line-height: 1.5;
}
.listing-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.listing-tag {
  background: var(--bg);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.listing-tag .icon { margin-right: 4px; }
.listing-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.listing-location {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}
.listing-cta {
  padding: 6px 16px;
  background: var(--primary-light);
  color: var(--primary);
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.listing-cta:hover { background: var(--primary); color: var(--white); }

/* ── Detail Panel (Expanded) ── */
.listing-detail {
  display: none;
  padding: 20px;
  border-top: 1px solid var(--border);
  background: #fafbfc;
}
.listing-detail.active { display: block; }
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.detail-item label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 2px;
}
.detail-item span {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}
.detail-features h4 {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}
.detail-features ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.detail-features li {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.detail-features li::before { content: "✓ "; color: #10b981; font-weight: 700; }
.detail-contact {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.detail-contact button {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}
.btn-contact, .btn-phone { display: inline-block; text-decoration: none; text-align: center; cursor: pointer; padding: 10px 20px; border-radius: var(--radius); font-size: 0.9rem; font-weight: 600; transition: all 0.2s; }
.btn-contact { background: var(--primary); color: var(--white); }
.btn-contact:hover { background: var(--primary-hover); }
.btn-phone { background: var(--white); color: var(--text); border: 1px solid var(--border) !important; }
.btn-phone:hover { border-color: var(--primary) !important; color: var(--primary); }

/* ── Footer ── */
.footer {
  background: var(--text);
  color: #9ca3af;
  padding: 48px 24px 24px;
  margin-top: 48px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
}
.footer h4 { color: var(--white); font-size: 0.95rem; margin-bottom: 12px; }
.footer a { color: #9ca3af; text-decoration: none; font-size: 0.85rem; display: block; padding: 3px 0; }
.footer a:hover { color: var(--white); }
.footer-bottom {
  max-width: 1200px;
  margin: 32px auto 0;
  padding-top: 16px;
  border-top: 1px solid #374151;
  font-size: 0.8rem;
  display: flex;
  justify-content: space-between;
}

/* ── Steps & Cities Grids ── */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  text-align: center;
}
.cities-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.8rem; }
  .hero p { font-size: 1rem; }
  .search-bar { flex-direction: column; }
  .search-bar select { min-width: 0; }
  .steps-grid { grid-template-columns: 1fr; gap: 24px; }
  .cities-grid { grid-template-columns: repeat(2, 1fr); }
  .listings-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  /* Scroll offset so card doesn't hide behind sticky topnav */
  .listing-card.detail-open {
    scroll-margin-top: 75px;
  }
}
@media (max-width: 480px) {
  .footer-inner { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .cities-grid { grid-template-columns: 1fr; }
  .listing-card.detail-open {
    scroll-margin-top: 75px;
  }
}

/* ── Utility ── */
.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.mt-2 { margin-top: 16px; }
.mb-2 { margin-bottom: 16px; }

/* ── Placeholder image with icon ── */
.img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  opacity: 0.3;
}

/* ── Cookie Banner ── */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--white);
  border-top: 2px solid var(--primary);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.15);
  padding: 20px 24px;
  display: none;
  animation: slideUp 0.4s ease;
}
.cookie-banner.visible { display: block; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.cookie-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.cookie-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
}
.cookie-text a { color: var(--primary); text-decoration: underline; }
.cookie-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.cookie-actions button {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}
.btn-accept { background: var(--primary); color: var(--white); }
.btn-accept:hover { background: var(--primary-hover); }
.btn-settings { background: var(--bg); color: var(--text); border: 1px solid var(--border) !important; }
.btn-settings:hover { border-color: var(--primary) !important; color: var(--primary); }

/* ── Cookie Settings Modal ── */
.cookie-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
.cookie-modal-overlay.visible { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.cookie-modal {
  background: var(--white);
  border-radius: 16px;
  padding: 32px;
  max-width: 520px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.cookie-modal h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.cookie-modal p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}
.cookie-category {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
}
.cookie-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.cookie-category-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
}
.cookie-category-header p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
}
/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }
.toggle-switch input:disabled + .toggle-slider { opacity: 0.5; cursor: not-allowed; }
.cookie-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.cookie-modal-actions button {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

/* ── Header Controls (theme + font in nav) ── */
.header-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: 8px;
}
.header-ctrl {
  width: 36px;
  height: 36px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  color: var(--text-secondary);
  padding: 0;
  line-height: 1;
}
.header-ctrl:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.header-ctrl.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}
.header-ctrl-font {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

/* ── Hamburger Menu ── */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 200;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2.5px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}
.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ── Mobile Menu Overlay ── */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}
.nav-overlay.visible { display: block; }

@media (max-width: 768px) {
  .hamburger { display: flex; }
  .topnav-links {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    background: var(--white);
    flex-direction: column;
    padding: 80px 24px 24px;
    gap: 8px;
    box-shadow: var(--shadow-lg);
    transition: right 0.3s ease;
    z-index: 100;
    overflow-y: auto;
  }
  .topnav-links.open {
    right: 0;
  }
  .topnav-links a {
    padding: 12px 16px;
    font-size: 1.05rem;
    border-radius: 8px;
  }
  .topnav-links .header-controls {
    justify-content: center;
    margin: 8px 0 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
  }
  .topnav-links .btn-post {
    width: 100%;
    text-align: center;
    padding: 12px;
    margin-top: 8px;
  }
  .cookie-inner { flex-direction: column; text-align: center; }
  .cookie-actions { width: 100%; justify-content: center; }
  .header-controls { gap: 2px; margin-right: 4px; }
  .header-ctrl { width: 32px; height: 32px; font-size: 0.85rem; }
}
