/* ═══════════════════════════════════════════════════════
   Çevreci Adeo — App CSS
   Glassmorphism + Mobil Öncelikli Tasarım Sistemi
   ═══════════════════════════════════════════════════════ */

/* ─── CSS Variables ────────────────────────────────── */
:root {
    --brand: #D95938;
    --brand-light: #FEF2EE;
    --brand-dark: #933A25;
    --warm-50: #FDFBF7;
    --warm-100: #F5EFE3;
    --warm-200: #EDE3CF;
    --warm-300: #E0D5BF;
    --ink-50: #F5F5F4;
    --ink-100: #E7E5E4;
    --ink-200: #D6D3D1;
    --ink-600: #57534E;
    --ink-700: #44403C;
    --ink-800: #292524;
    --ink-900: #0C0A09;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    color-scheme: light only;
}

/* ─── Reset & Base ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    background: var(--warm-50);
    color: var(--ink-800);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
    padding-left: var(--safe-left);
    padding-right: var(--safe-right);
}

/* ─── Gradient Background ──────────────────────────── */
.gradient-bg {
    background: linear-gradient(135deg, var(--warm-50) 0%, var(--brand-light) 30%, var(--warm-100) 60%, #EBF5FF 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    min-height: 100dvh;
}

@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ─── Glassmorphism ────────────────────────────────── */
.glass {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 1.25rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}

.glass-strong {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 1.25rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.glass-tab {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.06);
}

.glass-dark {
    background: rgba(12, 10, 9, 0.75);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.25rem;
    color: white;
}

/* ─── Animations ───────────────────────────────────── */
.slide-up {
    animation: slideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    opacity: 0;
}

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

.float {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-10px); }
}

.pulse-ring {
    animation: pulseRing 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulseRing {
    0%, 100% { box-shadow: 0 0 0 0 rgba(217, 89, 56, 0.4); }
    50%      { box-shadow: 0 0 0 12px rgba(217, 89, 56, 0); }
}

.touch-scale {
    transition: transform 0.15s ease;
}
.touch-scale:active {
    transform: scale(0.96);
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ─── Brand Colors (dynamic) ───────────────────────── */
.brand-bg   { background-color: var(--brand); }
.brand-text { color: var(--brand); }
.brand-border { border-color: var(--brand); }

/* ─── Tab Bar ──────────────────────────────────────── */
.tab-active {
    color: var(--brand);
    font-weight: 600;
    position: relative;
}
.tab-active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 3px;
    background: var(--brand);
    border-radius: 999px;
}

.tab-inactive {
    color: var(--ink-600);
    font-weight: 400;
}

/* ─── Chip Filters ─────────────────────────────────── */
.chip-active {
    background: var(--brand);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(217, 89, 56, 0.3);
}

.chip-inactive {
    background: rgba(255, 255, 255, 0.6);
    color: var(--ink-700);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.chip-active, .chip-inactive {
    padding: 0.375rem 1rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
}

.chip-inactive:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--brand);
}

/* ─── Splash ───────────────────────────────────────── */
#app-splash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, var(--warm-50) 0%, var(--brand-light) 50%, var(--warm-100) 100%);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

#app-splash.splash-hide {
    opacity: 0;
    transform: scale(1.05);
    pointer-events: none;
}

.splash-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: blobFloat 8s ease-in-out infinite;
}

@keyframes blobFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(30px, -30px) scale(1.1); }
    66%      { transform: translate(-20px, 20px) scale(0.9); }
}

.splash-progress {
    width: 200px;
    height: 3px;
    background: rgba(217, 89, 56, 0.15);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 2rem;
}

.splash-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--brand), #F59E0B);
    border-radius: 999px;
    width: 0%;
    animation: splashProgress 2.8s ease-in-out forwards;
}

@keyframes splashProgress {
    0%   { width: 0%; }
    30%  { width: 40%; }
    60%  { width: 70%; }
    100% { width: 100%; }
}

/* ─── Bottom Tab Bar ───────────────────────────────── */
#tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding-bottom: var(--safe-bottom);
}

.tab-bar-inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 60px;
    max-width: 480px;
    margin: 0 auto;
}

.tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.6875rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.tab-btn svg {
    width: 22px;
    height: 22px;
    transition: transform 0.2s ease;
}

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

/* ─── Page Content ─────────────────────────────────── */
.page-content {
    max-width: 480px;
    margin: 0 auto;
    padding: 1rem 1rem 5rem;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ─── Cards ────────────────────────────────────────── */
.info-card {
    padding: 1.25rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

.pharmacy-card {
    padding: 1.25rem;
    transition: transform 0.15s ease;
}

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

/* ─── Buttons ──────────────────────────────────────── */
.btn-brand {
    background: var(--brand);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.875rem;
    font-weight: 600;
    font-size: 0.9375rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 4px 12px rgba(217, 89, 56, 0.3);
}

.btn-brand:hover {
    filter: brightness(1.08);
    box-shadow: 0 6px 20px rgba(217, 89, 56, 0.4);
    transform: translateY(-1px);
}

.btn-brand:active {
    transform: scale(0.97);
}

.btn-outline {
    background: transparent;
    color: var(--brand);
    border: 2px solid var(--brand);
    padding: 0.625rem 1.25rem;
    border-radius: 0.875rem;
    font-weight: 600;
    font-size: 0.875rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    -webkit-tap-highlight-color: transparent;
}

.btn-outline:hover {
    background: var(--brand-light);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    border-radius: 0.625rem;
}

.btn-danger {
    background: #DC2626;
    color: white;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-success {
    background: #059669;
    color: white;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

/* ─── Form Elements ────────────────────────────────── */
.input-glass {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.75rem;
    font-size: 0.9375rem;
    font-family: 'Inter', sans-serif;
    color: var(--ink-800);
    transition: all 0.2s ease;
    outline: none;
}

.input-glass:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(217, 89, 56, 0.15);
    background: rgba(255, 255, 255, 0.9);
}

.input-glass::placeholder {
    color: var(--ink-600);
    opacity: 0.6;
}

/* ─── Toast ────────────────────────────────────────── */
#toast-container {
    position: fixed;
    top: calc(1rem + var(--safe-top));
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    pointer-events: none;
}

.toast {
    padding: 0.875rem 1.5rem;
    border-radius: 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
    text-align: center;
    max-width: 90vw;
    pointer-events: auto;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.5s forwards;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.toast-basari {
    background: linear-gradient(135deg, #059669, #10B981);
}

.toast-hata {
    background: linear-gradient(135deg, #DC2626, #EF4444);
}

@keyframes toastIn {
    from { transform: translateY(-20px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

@keyframes toastOut {
    from { transform: translateY(0);     opacity: 1; }
    to   { transform: translateY(-20px); opacity: 0; }
}

/* ─── Modal ────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 5000;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.2s ease;
    padding: 1rem;
    padding-bottom: calc(1rem + var(--safe-bottom));
}

.modal-content {
    width: 100%;
    max-width: 420px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 1.5rem;
    animation: slideUp 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (min-width: 640px) {
    .modal-overlay { align-items: center; }
}

/* ─── Badge ────────────────────────────────────────── */
.badge-red {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #FEE2E2;
    color: #DC2626;
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    letter-spacing: 0.02em;
}

.badge-green {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #D1FAE5;
    color: #059669;
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
}

.badge-amber {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #FEF3C7;
    color: #D97706;
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
}

/* ─── Admin Panel ──────────────────────────────────── */
.admin-nav {
    display: flex;
    overflow-x: auto;
    gap: 0.25rem;
    padding: 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.admin-nav::-webkit-scrollbar { display: none; }

.admin-tab {
    padding: 0.5rem 0.875rem;
    border-radius: 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

.admin-tab-active {
    background: var(--brand);
    color: white;
    box-shadow: 0 2px 8px rgba(217, 89, 56, 0.3);
}

.admin-tab-inactive {
    background: rgba(255, 255, 255, 0.5);
    color: var(--ink-700);
}

.admin-tab-inactive:hover {
    background: rgba(255, 255, 255, 0.8);
}

/* ─── Table ────────────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.8125rem;
}

.data-table th {
    background: rgba(217, 89, 56, 0.08);
    padding: 0.625rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--ink-700);
    position: sticky;
    top: 0;
    white-space: nowrap;
}

.data-table td {
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    vertical-align: middle;
}

.data-table tr:hover td {
    background: rgba(217, 89, 56, 0.03);
}

.table-container {
    overflow-x: auto;
    border-radius: 0.75rem;
    -webkit-overflow-scrolling: touch;
}

/* ─── Stat Card ────────────────────────────────────── */
.stat-card {
    text-align: center;
    padding: 1rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--brand);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--ink-600);
    margin-top: 0.25rem;
    font-weight: 500;
}

/* ─── Kutu Panel ───────────────────────────────────── */
.kutu-panel {
    text-align: center;
    padding: 2rem 1.5rem;
}

.kutu-btn-dolu {
    width: 100%;
    padding: 1.25rem;
    background: linear-gradient(135deg, #DC2626, #EF4444);
    color: white;
    border: none;
    border-radius: 1rem;
    font-size: 1.125rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.3);
}

.kutu-btn-dolu:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(220, 38, 38, 0.4);
}

.kutu-btn-dolu:active {
    transform: scale(0.97);
}

.kutu-btn-dolu:disabled {
    background: #9CA3AF;
    box-shadow: none;
    cursor: not-allowed;
}

/* ─── Loading Spinner ──────────────────────────────── */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(217, 89, 56, 0.2);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

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

/* ─── Scrollbar ────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.12); border-radius: 999px; }

/* ─── Utilities ────────────────────────────────────── */
.text-brand { color: var(--brand); }
.bg-brand { background-color: var(--brand); }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── Icon Colors ──────────────────────────────────── */
.icon-brand   { color: var(--brand); }
.icon-emerald { color: #059669; }
.icon-sky     { color: #0284C7; }
.icon-amber   { color: #D97706; }

/* ─── PWA Install Banner ───────────────────────────── */
.pwa-banner {
    position: fixed;
    bottom: 80px;
    left: 1rem;
    right: 1rem;
    z-index: 200;
    max-width: 440px;
    margin: 0 auto;
    padding: 1.25rem;
    animation: slideUp 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ─── Responsive ───────────────────────────────────── */
@media (min-width: 768px) {
    .page-content {
        max-width: 560px;
        padding: 2rem 2rem 5rem;
    }
}

@media (max-width: 360px) {
    .btn-brand { font-size: 0.875rem; padding: 0.625rem 1rem; }
    .stat-value { font-size: 1.5rem; }
}

/* ─── Admin Login ──────────────────────────────────── */
.login-container {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 380px;
    padding: 2rem;
}

/* ─── Color Picker ─────────────────────────────────── */
.color-swatch {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s ease;
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch.active {
    border-color: var(--ink-800);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

/* ─── Icon Picker Grid ─────────────────────────────── */
.icon-picker-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
}

.icon-picker-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem;
    border-radius: 0.625rem;
    cursor: pointer;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.15s ease;
}

.icon-picker-item:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--brand);
}

.icon-picker-item.active {
    background: var(--brand-light);
    border-color: var(--brand);
}

/* ─── Belediye Card ────────────────────────────────── */
.belediye-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 0.875rem;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.belediye-card:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.belediye-logo {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    object-fit: contain;
    background: white;
    padding: 4px;
}

/* ─── Distance Badge ───────────────────────────────── */
.distance-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(217, 89, 56, 0.1);
    color: var(--brand);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
}
