/* ===========================================================
   etkinlik.biz — Mobile-first, native-app hissiyatlı arayüz
   =========================================================== */

:root {
    --color-primary: #6C5CE7;
    --color-primary-dark: #5849c2;
    --color-primary-light: #efecff;
    --color-accent: #00CEC9;
    --color-danger: #E74C3C;
    --color-warning: #F39C12;
    --color-success: #27AE60;

    --color-bg: #F7F7FB;
    --color-surface: #FFFFFF;
    --color-border: #ECECF3;
    --color-text: #1C1B29;
    --color-text-muted: #6B6B7B;
    --color-text-faint: #A2A2B3;

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-pill: 999px;

    --shadow-sm: 0 1px 3px rgba(28, 27, 41, 0.06);
    --shadow-md: 0 4px 16px rgba(28, 27, 41, 0.08);
    --shadow-lg: 0 8px 30px rgba(28, 27, 41, 0.12);

    --nav-height: 64px;
    --topbar-height: 56px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: none;
    touch-action: manipulation;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 16px; }

/* ---------- App shell ---------- */
.app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--color-bg);
    position: relative;
    display: flex;
    flex-direction: column;
}

.app-content {
    flex: 1;
    padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
}

.app-content.no-nav {
    padding-bottom: 24px;
}

.app-content.event-nav {
    padding-bottom: calc(76px + var(--safe-bottom) + 16px);
}

/* ---------- Top bar ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: var(--topbar-height);
    padding-top: var(--safe-top);
    background: rgba(247, 247, 251, 0.92);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 16px;
    padding-right: 16px;
    border-bottom: 1px solid var(--color-border);
}

.topbar h1 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.topbar-action {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-pill);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
    font-size: 18px;
}

/* ---------- Bottom navigation ---------- */
.bottom-nav {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 100%;
    max-width: 480px;
    height: calc(var(--nav-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 30;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--color-text-faint);
    font-size: 11px;
    font-weight: 600;
    flex: 1;
    height: 100%;
    position: relative;
}

.nav-item .nav-icon { font-size: 21px; line-height: 1; }
.nav-item.active { color: var(--color-primary); }

.nav-item.nav-fab {
    margin-top: -26px;
}
.nav-item.nav-fab .nav-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), #8b7bf0);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    box-shadow: 0 6px 16px rgba(108, 92, 231, 0.45);
}

.nav-badge {
    position: absolute;
    top: 2px;
    right: calc(50% - 20px);
    background: var(--color-danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

/* ---------- Event action bar ---------- */
.event-action-bar {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 100%;
    max-width: 480px;
    padding: 10px 16px calc(10px + var(--safe-bottom));
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    z-index: 30;
}

.event-action-bar-info { min-width: 0; flex: 1; }

.event-action-bar-date {
    font-size: 11px;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: .3px;
}

.event-action-bar-title {
    font-size: 13.5px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.event-action-bar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.event-action-bar-share {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: var(--radius-pill);
    background: var(--color-bg);
    border: 1.5px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
}

.event-action-bar-cta {
    width: auto;
    padding: 12px 22px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
}

/* ---------- Event detail page layout ---------- */
.event-hero-desktop,
.event-dateloc-desktop { display: none; }

@media (min-width: 880px) {
    .app.app-wide { max-width: 1040px; }

    .event-action-bar { max-width: 1040px; }

    .event-page-grid {
        display: grid;
        grid-template-columns: 1fr 340px;
        gap: 32px;
        align-items: start;
    }
    .event-page-side {
        position: sticky;
        top: calc(var(--topbar-height) + 20px);
    }
    .event-hero-mobile,
    .event-dateloc-mobile { display: none; }
    .event-hero-desktop {
        display: block;
        border-radius: var(--radius-lg);
        overflow: hidden;
        margin-bottom: 16px;
    }
    .event-hero-desktop .event-card-media { height: 220px; border-radius: 0; font-size: 64px; }
    .event-dateloc-desktop { display: block; }
}

.map-wrap { position: relative; }
.map-pin-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-surface);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    z-index: 5;
}

.detay-desc.clamped {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.link-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--color-primary);
    cursor: pointer;
    display: none;
    margin-top: 8px;
}

.share-option-list { display: flex; flex-direction: column; gap: 6px; }
.share-option-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    padding: 13px 14px;
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
}

.participant-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-top: 1px solid var(--color-border);
}
.participant-row:first-child { border-top: none; }
.participant-row img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.participant-row-name { font-size: 13.5px; font-weight: 600; }
.participant-row-role { font-size: 11.5px; color: var(--color-text-faint); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    border: none;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .06s ease, opacity .15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-secondary { background: var(--color-surface); color: var(--color-text); border: 1.5px solid var(--color-border); }
.btn-outline { background: transparent; color: var(--color-primary); border: 1.5px solid var(--color-primary); }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--color-text-muted); }
.btn-sm { padding: 9px 14px; font-size: 13px; width: auto; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-google {
    background: #fff;
    color: #1C1B29;
    border: 1.5px solid var(--color-border);
}

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}
.field input[type=text],
.field input[type=email],
.field input[type=password],
.field input[type=date],
.field input[type=number],
.field input[type=search],
.field input[type=datetime-local],
.field select,
.field textarea {
    width: 100%;
    padding: 13px 14px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
    border-color: var(--color-primary);
}
.field textarea { resize: vertical; min-height: 80px; }
.field-hint { font-size: 12px; color: var(--color-text-faint); margin-top: 4px; }
.field-error { font-size: 12px; color: var(--color-danger); margin-top: 4px; }

.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    padding: 9px 14px;
    border-radius: var(--radius-pill);
    border: 1.5px solid var(--color-border);
    background: var(--color-surface);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}
.chip.active {
    background: var(--color-primary-light);
    border-color: var(--color-primary);
    color: var(--color-primary-dark);
}
.chip input { display: none; }

/* ---------- Cards ---------- */
.card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 16px;
}

.event-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 14px;
    display: block;
}
.event-card-media {
    height: 96px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    position: relative;
}
.event-card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.35);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    backdrop-filter: blur(4px);
}
.event-card-badge.now {
    background: var(--color-danger);
}
.event-card-body { padding: 14px; }
.event-card-title { font-size: 16px; font-weight: 700; margin: 0 0 4px; }
.event-card-meta { font-size: 12.5px; color: var(--color-text-muted); display: flex; align-items: center; gap: 5px; margin-bottom: 3px; }
.event-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.avatar-stack { display: flex; }
.avatar-stack img {
    width: 26px; height: 26px; border-radius: 50%;
    border: 2px solid #fff; object-fit: cover;
    margin-left: -8px;
}
.avatar-stack img:first-child { margin-left: 0; }
.capacity-pill {
    font-size: 12px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: var(--radius-pill);
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
}
.capacity-pill.full { background: #fdeceb; color: var(--color-danger); }

/* ---------- Auth screens ---------- */
.auth-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 32px 24px;
    max-width: 480px;
    margin: 0 auto;
}
.auth-logo {
    text-align: center;
    margin-bottom: 28px;
}
.auth-logo .emoji { font-size: 44px; }
.auth-logo h1 {
    font-size: 22px;
    font-weight: 800;
    margin: 6px 0 2px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.auth-logo p { color: var(--color-text-muted); font-size: 13px; margin: 0; }
.auth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0;
    color: var(--color-text-faint);
    font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--color-border);
}
.auth-footer-link { text-align: center; margin-top: 18px; font-size: 13.5px; color: var(--color-text-muted); }
.auth-footer-link a { color: var(--color-primary); font-weight: 700; }

.alert {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    margin-bottom: 16px;
}
.alert-error { background: #fdeceb; color: var(--color-danger); }
.alert-success { background: #e9f9ef; color: var(--color-success); }
.alert-info { background: var(--color-primary-light); color: var(--color-primary-dark); }

/* ---------- Section helpers ---------- */
.section { padding: 16px; }
.section-title {
    font-size: 15px;
    font-weight: 800;
    margin: 4px 0 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-text-faint);
}
.empty-state .emoji { font-size: 40px; margin-bottom: 10px; }

.filter-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 16px 12px;
    scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip {
    flex-shrink: 0;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}
.filter-chip.active { background: var(--color-text); color: #fff; border-color: var(--color-text); }
.filter-chip.now-chip.active { background: var(--color-danger); border-color: var(--color-danger); }
.filter-chip.show-all-chip { display: none; border-style: dashed; }

@media (min-width: 640px) {
    .filter-row { flex-wrap: wrap; overflow: visible; padding-bottom: 8px; }
    .filter-chip.cat-overflow { display: none; }
    .filter-chip.show-all-chip { display: inline-flex; align-items: center; }
}

.search-bar {
    margin: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-pill);
    padding: 10px 16px;
}
.search-bar input { border: none; outline: none; flex: 1; background: transparent; font-size: 14px; }

/* ---------- Utility ---------- */
.text-muted { color: var(--color-text-muted); }
.text-faint { color: var(--color-text-faint); }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8 { gap: 8px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }

.spinner {
    width: 18px; height: 18px;
    border: 2.5px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
    position: fixed;
    bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-text);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius-pill);
    font-size: 13.5px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    z-index: 60;
    max-width: 90%;
    text-align: center;
}

#map { width: 100%; border-radius: var(--radius-md); }

.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(28,27,41,0.5);
    z-index: 50;
    display: flex;
    align-items: flex-end;
}
.modal-sheet {
    background: var(--color-surface);
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    border-radius: 20px 20px 0 0;
    padding: 20px;
    max-height: 85vh;
    overflow-y: auto;
}
.modal-handle {
    width: 40px; height: 4px;
    background: var(--color-border);
    border-radius: 2px;
    margin: 0 auto 14px;
}
