/* ============================================================
   EMLAK GALERİ - CSS
   Premium Dark Real Estate Gallery
   ============================================================ */

:root {
  --bg:          #070709;
  --bg2:         #0e0e14;
  --bg3:         #16161f;
  --border:      rgba(255,255,255,0.07);
  --border2:     rgba(255,255,255,0.12);
  --text:        #f0f0f5;
  --text2:       #9090a8;
  --text3:       #5a5a70;
  --gold:        #c8a96e;
  --gold2:       #e8c98e;
  --accent:      #3d7fff;
  --accent2:     #6499ff;
  --red:         #ff5555;
  --green:       #55cc88;
  --radius:      12px;
  --radius2:     8px;
  --shadow:      0 8px 32px rgba(0,0,0,0.6);
  --transition:  0.2s cubic-bezier(0.4,0,0.2,1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── HEADER ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7,7,9,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
}

.header-inner {
  max-width: 1600px;
  margin: 0 auto;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-icon {
  font-size: 24px;
  color: var(--gold);
  line-height: 1;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.logo-main {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 3px;
}

.logo-sub {
  font-size: 9px;
  letter-spacing: 4px;
  color: var(--gold);
  text-transform: uppercase;
  margin-top: 2px;
}

.header-stats {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
}

.stat-num {
  font-weight: 600;
  font-size: 14px;
  color: var(--gold);
}

.stat-lbl {
  font-size: 11px;
  color: var(--text3);
}

.btn-refresh {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius2);
  color: var(--text2);
  text-decoration: none;
  padding: 7px 14px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-refresh svg { width: 14px; height: 14px; }
.btn-refresh:hover { color: var(--text); border-color: var(--gold); }

/* ── SEARCH SECTION ── */
.search-section {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  position: sticky;
  top: 64px;
  z-index: 90;
}

.search-inner {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text3);
  pointer-events: none;
}

#searchInput {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  padding: 11px 42px 11px 44px;
  outline: none;
  transition: var(--transition);
}

#searchInput:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200,169,110,0.1);
}

#searchInput::placeholder { color: var(--text3); }

.clear-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  border-radius: 50%;
  transition: var(--transition);
}
.clear-btn:hover { color: var(--text); background: var(--bg3); }

.filter-row, .sort-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text2);
  font-family: inherit;
  font-size: 13px;
  padding: 6px 14px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.filter-btn:hover { color: var(--text); border-color: var(--border2); }
.filter-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #000;
  font-weight: 600;
}

.sort-label {
  font-size: 13px;
  color: var(--text3);
  white-space: nowrap;
}

#sortSelect {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 6px 12px;
  outline: none;
  cursor: pointer;
}

.view-toggles {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.view-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  color: var(--text3);
  cursor: pointer;
  padding: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.view-btn svg { width: 15px; height: 15px; }
.view-btn.active { color: var(--gold); border-color: var(--gold); }
.view-btn:hover { color: var(--text); }

.results-count {
  font-size: 12px;
  color: var(--text3);
}

/* ── GALLERY MAIN ── */
.gallery-main {
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* ── PROPERTY GRID ── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* List view */
.gallery-grid.list-view {
  grid-template-columns: 1fr;
}

.gallery-grid.list-view .property-card {
  display: flex;
  flex-direction: row;
}

.gallery-grid.list-view .card-thumb-wrap {
  width: 200px;
  height: 140px;
  flex-shrink: 0;
  border-radius: var(--radius) 0 0 var(--radius);
}

.gallery-grid.list-view .card-info {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ── PROPERTY CARD ── */
.property-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.property-card:hover {
  transform: translateY(-4px);
  border-color: var(--border2);
  box-shadow: var(--shadow);
}

.card-thumb-wrap {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--bg3);
}

.card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.property-card:hover .card-thumb {
  transform: scale(1.05);
}

.no-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text3);
  height: 100%;
}

.no-thumb svg { width: 40px; height: 40px; }
.no-thumb span { font-size: 12px; }

/* Overlay */
.card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}

.property-card:hover .card-overlay { opacity: 1; }

.btn-open {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gold);
  color: #000;
  border: none;
  border-radius: var(--radius2);
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 20px;
  cursor: pointer;
  transition: transform var(--transition);
}

.btn-open:hover { transform: scale(1.04); }
.btn-open svg { width: 14px; height: 14px; }

/* Badges */
.card-badges {
  position: absolute;
  bottom: 8px;
  left: 8px;
  display: flex;
  gap: 6px;
}

.badge {
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(8px);
}

.badge svg { width: 12px; height: 12px; }

.badge-photo {
  background: rgba(0,0,0,0.7);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
}

.badge-video {
  background: rgba(255,85,85,0.8);
  color: #fff;
}

.badge-lowres {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255,165,0,0.85);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 5px;
  backdrop-filter: blur(4px);
}

.card-info {
  padding: 14px 16px;
}

.card-name {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  font-size: 12px;
  color: var(--text3);
}

/* ── EMPTY STATE ── */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--text2);
}

.empty-icon { font-size: 60px; margin-bottom: 16px; }
.empty-state h2 { font-size: 24px; margin-bottom: 8px; color: var(--text); }
.empty-state p { font-size: 15px; line-height: 1.6; }
.empty-state code { 
  background: var(--bg3); 
  padding: 2px 7px; 
  border-radius: 4px; 
  font-size: 13px; 
  color: var(--gold);
}

.empty-structure {
  margin-top: 24px;
  display: inline-block;
  text-align: left;
}

.empty-structure pre {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  font-size: 13px;
  color: var(--text2);
  line-height: 1.8;
}

.no-results {
  text-align: center;
  padding: 60px;
  color: var(--text2);
}

.no-results .empty-icon { font-size: 48px; margin-bottom: 12px; }
.no-results button {
  margin-top: 16px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius2);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 8px 20px;
  cursor: pointer;
}

/* ── LIGHTBOX ── */
.lightbox-bg {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 900;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 901;
  display: flex;
  flex-direction: column;
  background: #0a0a0f;
}

/* LB Header */
.lb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 16px;
}

.lb-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.lb-title {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-subtitle {
  font-size: 13px;
  color: var(--text3);
  white-space: nowrap;
}

.lb-header-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.lb-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  color: var(--text2);
  cursor: pointer;
  padding: 8px 12px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.lb-btn svg { width: 16px; height: 16px; }
.lb-btn:hover { color: var(--text); border-color: var(--border2); }

/* LB Stage */
.lb-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.lb-media-wrap {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#lbImg {
  max-width: 100%;
  max-height: calc(100vh - 240px);
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

#lbVideo {
  max-width: 100%;
  max-height: calc(100vh - 240px);
  border-radius: var(--radius);
  outline: none;
}

.lb-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* LB Nav */
.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.6);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 10;
  backdrop-filter: blur(4px);
}

.lb-prev { left: 12px; }
.lb-next { right: 12px; }
.lb-nav svg { width: 20px; height: 20px; }
.lb-nav:hover { background: var(--gold); color: #000; border-color: var(--gold); }

/* LB Info bar */
.lb-info-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text3);
  flex-shrink: 0;
}

.lb-info-bar span:last-child { margin-left: auto; }

.lb-lowres-warn {
  color: orange;
  font-weight: 600;
}

/* LB Thumbnail strip */
.lb-strip-wrap {
  padding: 8px 12px 12px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  flex-shrink: 0;
}

.lb-strip-wrap::-webkit-scrollbar { height: 4px; }
.lb-strip-wrap::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.lb-strip {
  display: flex;
  gap: 6px;
  min-width: min-content;
}

.lb-thumb-item {
  width: 64px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  border: 2px solid transparent;
  transition: border-color var(--transition);
  position: relative;
  background: var(--bg3);
}

.lb-thumb-item img,
.lb-thumb-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lb-thumb-item.active { border-color: var(--gold); }
.lb-thumb-item:hover { border-color: var(--border2); }

.lb-thumb-video-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 18px;
}

/* Slideshow active state */
.lb-btn.slideshow-active {
  background: var(--gold);
  color: #000;
  border-color: var(--gold);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .header-inner { padding: 0; }
  .logo-sub { display: none; }
  .stat-pill { padding: 4px 8px; }
  .stat-lbl { display: none; }
  
  .gallery-grid { 
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }
  
  .card-name { font-size: 13px; }
  .btn-open { font-size: 12px; padding: 8px 14px; }
  
  .lb-nav { width: 36px; height: 36px; }
  .lb-nav svg { width: 16px; height: 16px; }
  .lb-prev { left: 4px; }
  .lb-next { right: 4px; }
  
  #lbImg { max-height: calc(100vh - 280px); }
  .lb-title { font-size: 15px; }
  
  .gallery-grid.list-view .card-thumb-wrap {
    width: 120px;
    height: 100px;
  }

  .filter-btn { font-size: 11px; padding: 5px 10px; }
}

@media (max-width: 480px) {
  .search-section { top: 56px; padding: 12px 12px; }
  .gallery-main { padding: 16px 12px 40px; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .card-info { padding: 10px 12px; }
  .card-name { font-size: 12px; }
  .card-meta { font-size: 11px; }
  .header-stats { display: none; }
}

@media (min-width: 1400px) {
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border2); }

/* Smooth reveal animation */
.property-card {
  animation: fadeUp 0.4s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
