/* ═══════════════════════════════════════════
   İbrahim Yavuz v2 — Premium Design System
   ═══════════════════════════════════════════ */

/* ── Tokens ── */
:root {
    --bg: #08090e; --bg2: #111318; --bg3: #181b22; --bg4: #1e2129;
    --glass: rgba(17,19,24,.72); --glass-brd: rgba(255,255,255,.06);
    --brd: rgba(255,255,255,.08); --brd2: rgba(255,255,255,.04);
    --tx: #eaedf3; --tx2: #7c8294; --tx3: #4a4f5e;
    --ac: #d4a96a; --ac2: #e8c48a; --acd: rgba(212,169,106,.1);
    --acg: linear-gradient(135deg, #d4a96a 0%, #e8c48a 100%);
    --dn: #ef5f5f; --dnd: rgba(239,95,95,.1);
    --ok: #4dd47a; --okd: rgba(77,212,122,.08);
    --blue: #6ea8fe; --blued: rgba(110,168,254,.1);
    --r: 16px; --r-sm: 10px; --r-xs: 6px;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --shadow: 0 4px 24px rgba(0,0,0,.25);
    --shadow-lg: 0 12px 48px rgba(0,0,0,.4);
}
[data-theme="light"] {
    --bg: #f4f1ed; --bg2: #ffffff; --bg3: #f9f6f2; --bg4: #f0ece6;
    --glass: rgba(255,255,255,.78); --glass-brd: rgba(0,0,0,.06);
    --brd: rgba(0,0,0,.08); --brd2: rgba(0,0,0,.04);
    --tx: #1a1714; --tx2: #8a7f72; --tx3: #b5ab9e;
    --ac: #a07844; --ac2: #b8925e; --acd: rgba(160,120,68,.08);
    --acg: linear-gradient(135deg, #a07844 0%, #b8925e 100%);
    --dn: #d04545; --dnd: rgba(208,69,69,.08);
    --ok: #38a85c; --okd: rgba(56,168,92,.06);
    --blue: #4a7fd4; --blued: rgba(74,127,212,.08);
    --shadow: 0 4px 24px rgba(0,0,0,.06);
    --shadow-lg: 0 12px 48px rgba(0,0,0,.1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-tap-highlight-color: transparent; scroll-behavior: smooth; }
body {
    font-family: 'Outfit', -apple-system, sans-serif;
    background: var(--bg); color: var(--tx);
    min-height: 100vh; min-height: 100dvh;
    transition: background .4s ease, color .4s ease;
    overscroll-behavior: none; -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

/* ── Subtle texture ── */
body::before {
    content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
    opacity: .015;
    background: radial-gradient(circle at 20% 50%, var(--ac) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, var(--blue) 0%, transparent 50%);
}

.app { position: relative; z-index: 1; padding-bottom: calc(76px + var(--safe-b)); }
.container { max-width: 620px; margin: 0 auto; padding: 0 20px; }

/* ═══════ TOPBAR ═══════ */
.topbar {
    position: sticky; top: 0; z-index: 100;
    background: var(--glass); backdrop-filter: blur(24px) saturate(1.4);
    border-bottom: 1px solid var(--glass-brd);
    display: none;
}
.topbar.active { display: block; }
.topbar-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 60px; max-width: 620px; margin: 0 auto; padding: 0 20px;
}
.topbar-logo { display: flex; align-items: center; gap: 10px; }
.topbar-logo svg { color: var(--ac); width: 22px; height: 22px; }
.topbar-logo span {
    font-family: 'Playfair Display', serif; font-size: 18px; font-weight: 700;
    background: var(--acg); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.topbar-right { display: flex; align-items: center; gap: 2px; }

/* ═══════ BOTTOM NAV ═══════ */
.bottomnav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    background: var(--glass); backdrop-filter: blur(24px) saturate(1.4);
    border-top: 1px solid var(--glass-brd);
    padding-bottom: var(--safe-b);
    display: none; justify-content: space-around; align-items: center; height: 68px;
}
.bottomnav.active { display: flex; }
.nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 8px 20px; border-radius: 14px; cursor: pointer;
    transition: all .25s ease; background: none; border: none;
    font-family: inherit; color: var(--tx3); min-width: 72px;
    position: relative;
}
.nav-item.active { color: var(--ac); }
.nav-item.active::before {
    content: ''; position: absolute; top: -1px; left: 50%; transform: translateX(-50%);
    width: 20px; height: 3px; border-radius: 0 0 4px 4px;
    background: var(--acg);
}
.nav-item svg { transition: transform .2s ease; }
.nav-item.active svg { transform: scale(1.1); }
.nav-item span { font-size: 11px; font-weight: 600; letter-spacing: .2px; }

/* ═══════ BUTTONS ═══════ */
.btn {
    padding: 11px 20px; border-radius: var(--r-sm); font-size: 14px; font-weight: 500;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: none; font-family: inherit; cursor: pointer;
    transition: all .2s ease; white-space: nowrap;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
    position: relative; overflow: hidden;
}
.btn:active { transform: scale(.96); }
.btn-p {
    background: var(--acg); color: #fff; font-weight: 600;
    box-shadow: 0 2px 16px rgba(212,169,106,.25);
}
.btn-p:hover { box-shadow: 0 6px 28px rgba(212,169,106,.35); transform: translateY(-1px); }
.btn-g { background: transparent; color: var(--tx2); padding: 10px 12px; }
.btn-g:hover { color: var(--tx); }
.btn-o {
    background: var(--bg3); color: var(--tx); border: 1px solid var(--brd);
    backdrop-filter: blur(8px);
}
.btn-o:hover { border-color: var(--ac); color: var(--ac); }
.btn-d { background: var(--dnd); color: var(--dn); }
.btn-d:hover { background: rgba(239,95,95,.18); }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 8px; }
.btn-full { width: 100%; padding: 15px; font-size: 15px; font-weight: 600; border-radius: var(--r); }
.btn-call {
    background: var(--okd); color: var(--ok); padding: 5px 10px;
    font-size: 12px; border-radius: var(--r-xs); gap: 4px; font-weight: 600;
    text-decoration: none;
}
.btn-call:hover { background: rgba(77,212,122,.16); }

/* ═══════ INPUTS ═══════ */
.inp {
    width: 100%; padding: 13px 16px; border-radius: var(--r-sm);
    border: 1.5px solid var(--brd); background: var(--bg3);
    color: var(--tx); font-size: 15px; font-family: inherit;
    transition: all .25s ease; -webkit-appearance: none;
}
.inp:focus { outline: none; border-color: var(--ac); box-shadow: 0 0 0 4px var(--acd); background: var(--bg4); }
.inp::placeholder { color: var(--tx3); }
.inp-wrap { position: relative; }
.inp-wrap svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--tx3); width: 18px; height: 18px; transition: color .2s; }
.inp-wrap .inp { padding-left: 42px; }
.inp-wrap:focus-within svg { color: var(--ac); }
.inp-label { display: block; font-size: 12px; font-weight: 600; color: var(--tx2); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .4px; }

/* ═══════ CARDS ═══════ */
.card {
    background: var(--bg2); border-radius: var(--r); border: 1px solid var(--brd);
    overflow: hidden; box-shadow: var(--shadow);
    transition: box-shadow .3s ease;
}
.card-h {
    padding: 16px 20px; border-bottom: 1px solid var(--brd2);
    display: flex; align-items: center; justify-content: space-between;
}

/* ═══════ TOAST ═══════ */
.toast {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 1000;
    padding: 14px 24px; color: #fff; border-radius: var(--r);
    font-size: 14px; font-weight: 600; pointer-events: none;
    display: flex; align-items: center; gap: 8px;
    animation: toastIn .4s cubic-bezier(.22,1,.36,1);
    box-shadow: var(--shadow-lg); max-width: 380px; width: max-content;
}
.toast-ok { background: linear-gradient(135deg, #3ab563, #4dd47a); }
.toast-err { background: linear-gradient(135deg, #d04545, #ef5f5f); }
@keyframes toastIn {
    from { transform: translateX(-50%) translateY(-20px) scale(.9); opacity: 0; }
    to { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; }
}

/* ═══════ MODAL ═══════ */
.modal {
    position: fixed; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(12px);
    z-index: 200; display: flex; align-items: flex-end; justify-content: center;
    animation: modalBgIn .3s ease;
}
@media(min-width:520px) { .modal { align-items: center; padding: 24px; } }
.modal-box {
    background: var(--bg2); border-radius: 28px 28px 0 0;
    padding: 32px 24px calc(24px + var(--safe-b));
    width: 100%; max-width: 440px; border: 1px solid var(--glass-brd);
    animation: modalIn .35s cubic-bezier(.22,1,.36,1);
    max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg);
}
@media(min-width:520px) { .modal-box { border-radius: 28px; padding: 36px; } }
@keyframes modalBgIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ═══════ TAGS ═══════ */
.tag {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: var(--r-xs); font-size: 13px; font-weight: 500;
}
.tag-ac { background: var(--acd); color: var(--ac); }
.tag-ok { background: var(--okd); color: var(--ok); }
.tag button { background: none; border: none; color: inherit; cursor: pointer; padding: 0 0 0 2px; font-size: 15px; display: flex; opacity: .7; transition: opacity .15s; }
.tag button:hover { opacity: 1; }

/* ═══════ TIME GRID ═══════ */
.tgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tbtn {
    padding: 11px 0; border-radius: var(--r-sm); font-size: 14px; font-weight: 500;
    text-align: center; border: 1.5px solid var(--brd); cursor: pointer;
    background: var(--bg); color: var(--tx3); transition: all .2s ease; font-family: inherit;
}
.tbtn.on { background: var(--acg); color: #fff; border-color: transparent; box-shadow: 0 2px 12px rgba(212,169,106,.2); }
.tbtn:active { transform: scale(.94); }

/* ═══════ SLOT CARDS ═══════ */
.sgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media(min-width:500px) { .sgrid { grid-template-columns: repeat(3, 1fr); } }
.scard {
    border-radius: var(--r); border: 1.5px solid var(--brd); background: var(--bg3);
    padding: 14px; transition: all .2s ease; cursor: pointer;
}
.scard:hover { border-color: var(--ac); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(212,169,106,.08); }
.scard:active { transform: scale(.97) translateY(0); }
.scard.booked {
    background: var(--okd); border-color: rgba(77,212,122,.15); cursor: default;
}
.scard.booked:hover { transform: none; box-shadow: none; }
.scard .st { font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.scard .st.ok { color: var(--ok); }
.scard .sdot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.scard .sdot.dok { background: var(--ok); }
.scard .sdot.dfr { background: var(--tx3); }

/* ═══════ SERVICE BUTTONS ═══════ */
.sbtn {
    padding: 9px 16px; border-radius: 20px; font-size: 14px; font-weight: 500;
    background: var(--bg3); color: var(--tx); border: 1.5px solid var(--brd);
    cursor: pointer; transition: all .2s ease; font-family: inherit;
}
.sbtn.on { background: var(--acg); color: #fff; border-color: transparent; box-shadow: 0 2px 8px rgba(212,169,106,.2); }
.sbtn:active { transform: scale(.94); }

/* ═══════ BARBER TABS ═══════ */
.btab {
    padding: 9px 18px; border-radius: 20px; font-size: 14px; font-weight: 500;
    background: var(--bg3); color: var(--tx2); border: 1.5px solid var(--brd);
    cursor: pointer; transition: all .2s ease; font-family: inherit; white-space: nowrap;
}
.btab.on { background: var(--acg); color: #fff; border-color: transparent; font-weight: 600; }

/* ═══════ USER ROW ═══════ */
.urow {
    padding: 14px 20px; display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--brd2); transition: background .2s;
}
.urow:last-child { border-bottom: none; }
.urow:hover { background: var(--bg3); }
.uav {
    width: 42px; height: 42px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.uav.adm { background: var(--acd); color: var(--ac); }
.uav.brb { background: var(--okd); color: var(--ok); }
.uav.yon { background: var(--blued); color: var(--blue); }

/* ── Role Badge ── */
.role-badge {
    display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px;
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
}
.role-badge.admin { background: var(--acd); color: var(--ac); }
.role-badge.yonetici { background: var(--blued); color: var(--blue); }
.role-badge.barber { background: var(--okd); color: var(--ok); }

/* ═══════ SECTION TITLE ═══════ */
.stitle {
    font-size: 11px; font-weight: 700; color: var(--tx2); margin-bottom: 10px;
    text-transform: uppercase; letter-spacing: .8px;
}

/* ═══════ PAGES ═══════ */
.page { display: none; }
.page.active { display: block; animation: pageIn .45s cubic-bezier(.22,1,.36,1); }
@keyframes pageIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ═══════ LOGIN ═══════ */
.login-wrap {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; min-height: 100dvh; padding: 24px;
}
.login-box { width: 100%; max-width: 380px; }
.login-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 80px; height: 80px; border-radius: 24px;
    background: var(--acg); margin-bottom: 20px;
    box-shadow: 0 8px 40px rgba(212,169,106,.25);
}
.login-icon svg { color: #fff; width: 36px; height: 36px; }

/* ═══════ ANIMATIONS ═══════ */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
    width: 28px; height: 28px; border: 3px solid var(--brd);
    border-top-color: var(--ac); border-radius: 50%;
    animation: spin .7s linear infinite; margin: 0 auto;
}

/* ═══════ SCROLLBAR ═══════ */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { background: var(--brd); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ═══════ SELECT ═══════ */
.sel {
    padding: 8px 12px; border-radius: 8px; border: 1px solid var(--brd);
    background: var(--bg3); color: var(--tx); font-size: 13px; font-family: inherit; cursor: pointer;
}

/* ═══════ UTILITIES ═══════ */
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8 { gap: 8px; }
.gap-6 { gap: 6px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
