/* =========================================================
   YAKINDAKİLER — Ana Stil Dosyası
   Tema sistemi (CSS variables) + Glassmorphism + iOS tarzı UI
   ========================================================= */

:root {
    --bg: #f4f5f7;
    --bg-elevated: #ffffff;
    --surface: rgba(255, 255, 255, 0.72);
    --surface-blur: 20px;
    --text-primary: #14151a;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --border: rgba(0, 0, 0, 0.08);
    --accent: #ff5a3c;
    --accent-2: #ff8a5c;
    --accent-gradient: linear-gradient(135deg, #ff5a3c 0%, #ff8a5c 100%);
    --success: #22c55e;
    --danger: #ef4444;
    --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.08);
    --shadow-elevated: 0 16px 40px rgba(0, 0, 0, 0.12);
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 26px;
    --radius-full: 999px;
    --nav-height: 78px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    color-scheme: light;
}

[data-theme="dark"] {
    --bg: #0b0c10;
    --bg-elevated: #16171d;
    --surface: rgba(22, 23, 29, 0.72);
    --text-primary: #f5f5f7;
    --text-secondary: #a1a1aa;
    --text-tertiary: #6b6b74;
    --border: rgba(255, 255, 255, 0.08);
    --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.35);
    --shadow-elevated: 0 16px 40px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
}

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

html, body {
    height: 100%;
    overscroll-behavior-y: none;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    transition: background 0.35s ease, color 0.35s ease;
    -webkit-tap-highlight-color: transparent;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }

/* =========================================================
   LOADING EKRANI
   ========================================================= */
#loading-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    background: var(--bg);
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-logo {
    width: 84px;
    height: 84px;
    border-radius: 24px;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    font-weight: 800;
    color: #fff;
    box-shadow: 0 12px 40px rgba(255, 90, 60, 0.35);
    animation: logoPulse 2.2s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

.loading-dots {
    display: flex;
    gap: 10px;
}

.loading-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.3;
    animation: dotBlink 1.2s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBlink {
    0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-4px); }
}

/* =========================================================
   APP SHELL
   ========================================================= */
#app {
    opacity: 0;
    transition: opacity 0.5s ease;
    min-height: 100vh;
    padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
}

#app.visible { opacity: 1; }

/* =========================================================
   ÜST BAR
   ========================================================= */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    background: var(--surface);
    -webkit-backdrop-filter: blur(var(--surface-blur));
    backdrop-filter: blur(var(--surface-blur));
    border-bottom: 1px solid var(--border);
}

.topbar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 17px;
}

.topbar-logo .mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-primary);
    transition: transform 0.15s ease;
}

.icon-btn:active { transform: scale(0.9); }

/* =========================================================
   ARAMA ÇUBUĞU
   ========================================================= */
.search-wrap { padding: 14px 18px 4px; }

.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 12px 18px;
    box-shadow: var(--shadow-soft);
}

.search-bar input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 15px;
}

.search-bar input::placeholder { color: var(--text-tertiary); }

/* =========================================================
   KATEGORİ ŞERİDİ
   ========================================================= */
.category-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 16px 18px;
    scrollbar-width: none;
}
.category-scroll::-webkit-scrollbar { display: none; }

.category-pill {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-full);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.category-pill.active {
    background: var(--accent-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 18px rgba(255, 90, 60, 0.3);
}

/* =========================================================
   İŞLETME KARTLARI
   ========================================================= */
.section-title {
    padding: 8px 18px;
    font-size: 18px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-title span.link { font-size: 13px; font-weight: 600; color: var(--accent); }

.business-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 10px 18px 20px;
}

@media (min-width: 640px) {
    .business-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
    .business-grid { grid-template-columns: repeat(3, 1fr); }
}

.business-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: transform 0.25s cubic-bezier(.22,1,.36,1), box-shadow 0.25s ease;
}

.business-card:active { transform: scale(0.98); }

.business-card .cover {
    position: relative;
    height: 150px;
    background: linear-gradient(135deg, #ffe3d8, #ffd0c2);
    overflow: hidden;
}

.business-card .cover img { width: 100%; height: 100%; object-fit: cover; }

.business-card .badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: var(--radius-full);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.business-card .fav-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.business-card .body { padding: 14px 16px 16px; }

.business-card h3 { font-size: 15.5px; font-weight: 700; margin-bottom: 4px; }

.business-card .meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--text-secondary);
    margin-top: 6px;
}

.business-card .rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    color: var(--text-primary);
}

.business-card .distance {
    margin-left: auto;
    font-weight: 600;
    color: var(--accent);
}

.skeleton {
    background: linear-gradient(90deg, var(--border) 25%, rgba(255,255,255,0.15) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* =========================================================
   ALT MENÜ — iOS tarzı, şeffaf, blur, floating
   ========================================================= */
.bottom-nav {
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: calc(14px + var(--safe-bottom));
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: var(--nav-height);
    background: var(--surface);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-elevated);
    transition: transform 0.35s cubic-bezier(.22,1,.36,1), opacity 0.35s ease;
}

.bottom-nav.hidden {
    transform: translateY(140%);
    opacity: 0;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-tertiary);
    font-size: 10.5px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    transition: color 0.2s ease, transform 0.2s ease;
    position: relative;
}

.nav-item.active { color: var(--accent); }

.nav-item .nav-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s cubic-bezier(.22,1,.36,1);
}

.nav-item.active .nav-icon { transform: translateY(-3px) scale(1.12); }

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

.nav-item.center .nav-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: #fff;
    margin-top: -28px;
    box-shadow: 0 10px 26px rgba(255, 90, 60, 0.4);
}

/* =========================================================
   FORM / AUTH SAYFALARI
   ========================================================= */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 32px 24px;
    background: var(--bg);
}

.auth-card {
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    padding: 32px 26px;
    box-shadow: var(--shadow-elevated);
    border: 1px solid var(--border);
}

.auth-card h1 { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.auth-card p.subtitle { color: var(--text-secondary); font-size: 13.5px; margin-bottom: 24px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-secondary); }

.form-group input {
    width: 100%;
    padding: 13px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-primary);
    font-size: 14.5px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(255, 90, 60, 0.12);
}

.btn-primary {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-md);
    background: var(--accent-gradient);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    box-shadow: 0 10px 26px rgba(255, 90, 60, 0.32);
    transition: transform 0.15s ease;
}
.btn-primary:active { transform: scale(0.97); }

.form-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    margin-bottom: 16px;
}

.form-success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    margin-bottom: 16px;
}

.auth-switch { text-align: center; margin-top: 20px; font-size: 13.5px; color: var(--text-secondary); }
.auth-switch a { color: var(--accent); font-weight: 700; }

.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); margin-bottom: 18px; }

/* Tema anahtarı */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-secondary);
}
