/* ============================================================
   Rezervasyon — Ana Stil Dosyası
   ============================================================ */

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

:root {
    --green:        #004aad;
    --green-dark:   #003580;
    --green-light:  #e8f2ff;
    --green-glow:   #004aad40;
    --accent:       #2cbeda;
    --danger:       #e74c3c;
    --warning:      #f39c12;
    --info:         #2cbeda;
    --success:      #27ae60;
    --text:         #1a1a1a;
    --text-muted:   #6b7280;
    --border:       #e5e7eb;
    --bg:           #f8fafb;
    --card:         #ffffff;
    --radius:       12px;
    --radius-sm:    8px;
    --shadow:       0 1px 4px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
    --shadow-card:  0 2px 8px rgba(0,0,0,.06);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
    font-size: 15px;
    line-height: 1.6;
}

/* ============================================================
   GENEL ELEMENTLER
   ============================================================ */
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
    margin-top: 14px;
}
label:first-child { margin-top: 0; }

input[type=text], input[type=tel], input[type=email],
input[type=number], input[type=date], input[type=time],
textarea, select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    background: #fff;
    color: var(--text);
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px var(--green-glow);
}
textarea { resize: vertical; min-height: 70px; }

/* ============================================================
   BUTONLAR
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all .18s;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1;
}
.btn:hover { opacity: .88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); opacity: .95; }

.btn-primary  { background: var(--green); color: #fff; }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-success  { background: var(--success); color: #fff; }
.btn-ghost    { background: transparent; color: var(--green); border: 1.5px solid var(--green); }
.btn-full     { width: 100%; }
.btn-sm       { padding: 6px 12px; font-size: 13px; }

/* ============================================================
   BADGE / ETIKET
   ============================================================ */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.badge-success { background: #d4efdf; color: #1a7a40; }
.badge-warning { background: #fdebd0; color: #a04000; }
.badge-danger  { background: #fadbd8; color: #922b21; }
.badge-info    { background: #d6f5fa; color: #0e7490; }
.badge-neutral { background: #f0f0f0; color: #555; }

/* ============================================================
   ALERT
   ============================================================ */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-weight: 500;
}
.alert-success { background: #d4efdf; color: #1a7a40; border: 1px solid #a9dfbf; }
.alert-error   { background: #fadbd8; color: #922b21; border: 1px solid #f1948a; }
.alert-info    { background: #d6f5fa; color: #0e7490; border: 1px solid #7edce2; }

/* ============================================================
   AUTH SAYFASI
   ============================================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--green-dark) 0%, #001f4d 100%);
}
.auth-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}
.auth-logo { text-align: center; margin-bottom: 20px; }
.auth-logo-img { max-width: 180px; height: auto; margin-bottom: 8px; }
.auth-logo h1 { color: var(--green); font-size: 26px; font-weight: 800; }
.auth-logo p { color: var(--text-muted); font-size: 14px; margin-top: 4px; }
.auth-title { text-align: center; font-size: 24px; font-weight: 800; margin-bottom: 4px; }
.auth-subtitle { text-align: center; font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }
.auth-subtitle a { color: var(--green); font-weight: 600; }
.auth-subtitle a:hover { text-decoration: underline; }
.auth-info { color: var(--text-muted); font-size: 14px; margin-bottom: 16px; line-height: 1.5; text-align: center; }
.auth-note { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: 16px; }
.auth-back { display: block; text-align: center; margin-top: 16px; font-size: 14px; color: var(--text-muted); text-decoration: none; }
.auth-back:hover { color: var(--green); text-decoration: none; }

/* Label ile sağ taraf linki (ör: Şifremi Unuttum) */
.label-row { display: flex; align-items: center; justify-content: space-between; }
.label-row label { margin-bottom: 0; }
.label-link { font-size: 13px; font-weight: 600; color: var(--green); margin-top: 14px; }
.label-link:hover { text-decoration: underline; }

/* Şifre input wrapper (göz ikonu ile) */
.password-input-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
}
.password-input-wrap:focus-within {
    border-color: var(--green);
    box-shadow: 0 0 0 3px var(--green-glow);
}
.password-input-wrap input {
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    flex: 1;
    outline: none !important;
    padding: 10px 14px !important;
}
.password-input-wrap input:focus {
    border: none !important;
    box-shadow: none !important;
    outline: none;
}
.password-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.password-toggle:hover { color: var(--text); }
.password-toggle svg { width: 20px; height: 20px; }

/* Göz ikonu toggle: varsayılan → eye-icon görünür, eye-off gizli */
.password-input-wrap .eye-off-icon { display: none; }
.password-input-wrap .eye-icon { display: block; }
.password-input-wrap.showing .eye-off-icon { display: block; }
.password-input-wrap.showing .eye-icon { display: none; }

/* Alan bazlı hata mesajı */
.field-error {
    display: block;
    font-size: 12px;
    color: var(--danger);
    margin-top: 4px;
    font-weight: 500;
}

/* Hatalı input kenarlığı */
.input-error { border-color: var(--danger) !important; }
.phone-input-wrap:has(.input-error) { border-color: var(--danger); }
.password-input-wrap:has(.input-error) { border-color: var(--danger); }

.phone-input-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
}
.phone-input-wrap:focus-within {
    border-color: var(--green);
    box-shadow: 0 0 0 3px var(--green-glow);
}
.phone-prefix {
    padding: 10px 12px;
    background: var(--green-light);
    color: var(--green);
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
}
.phone-input-wrap input {
    border: none !important;
    box-shadow: none !important;
    border-radius: 0;
    flex: 1;
}
.otp-input {
    text-align: center;
    font-size: 28px !important;
    letter-spacing: 8px;
    font-weight: 700;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 56px;
    background: var(--green-dark);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.nav-brand { display: flex; align-items: center; }
.nav-logo  { height: 32px; width: auto; }
.nav-user  { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.nav-user-link { color: #fff; text-decoration: none; cursor: pointer; font-weight: 500; }
.nav-user-link:hover { text-decoration: underline; opacity: .9; }
.nav-user .btn-ghost {
    color: #fff;
    border-color: rgba(255,255,255,.4);
    padding: 6px 14px;
    font-size: 13px;
}

/* ============================================================
   DASHBOARD / CONTAINER
   ============================================================ */
.container { max-width: 900px; margin: 0 auto; padding: 24px 16px; }

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.section-header h2 { font-size: 20px; font-weight: 700; }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }

/* ============================================================
   REZERVASYON KARTI
   ============================================================ */
.reservation-list { display: flex; flex-direction: column; gap: 12px; }

.res-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 16px 20px;
    border-left: 4px solid var(--border);
    transition: transform .15s;
}
.res-card:hover { transform: translateY(-1px); }
.res-pending    { border-left-color: var(--warning); }
.res-approved   { border-left-color: var(--success); }
.res-rejected   { border-left-color: var(--danger); }
.res-cancelled  { border-left-color: #ccc; opacity: .75; }
.res-checked_in { border-left-color: var(--info); }
.res-completed  { border-left-color: #aaa; opacity: .75; }

.res-card-top { display: flex; align-items: flex-start; gap: 16px; }
.res-date {
    display: flex; flex-direction: column; align-items: center;
    min-width: 48px;
    background: var(--green-light);
    border-radius: 8px;
    padding: 6px 8px;
}
.res-dayname { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }
.res-day   { font-size: 22px; font-weight: 800; color: var(--green); line-height: 1; margin: 2px 0; }
.res-month { font-size: 11px; color: var(--green-dark); font-weight: 600; text-transform: uppercase; }
.res-info  { flex: 1; }
.res-title { font-weight: 700; font-size: 15px; }
.res-time  { font-size: 14px; color: var(--text-muted); margin-top: 2px; }
.res-meta  { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.res-status { align-self: flex-start; }

.res-qr-wrap   { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.res-admin-note {
    margin-top: 10px; padding: 8px 12px;
    background: #fff8ec; border-radius: 6px;
    font-size: 13px; color: #7a5200;
}
.res-actions { margin-top: 10px; display: flex; gap: 8px; }

/* ============================================================
   REZERVASYON POPUP — ANA YAPI
   ============================================================ */
.popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn .2s;
}
.popup-overlay.hidden { display: none; }

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

.popup-box {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: 0 8px 40px rgba(0,0,0,.22);
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp .25s;
    position: relative;
}
.popup-box-sm { max-width: 380px; padding: 24px; }

.popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}
.popup-header h3 { font-size: 18px; font-weight: 700; }
.popup-close {
    background: none; border: none; font-size: 20px;
    cursor: pointer; color: var(--text-muted);
    width: 32px; height: 32px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.popup-close:hover { background: var(--bg); }

/* Özet bar */
.selection-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 24px;
    background: var(--green-light);
    border-radius: 8px;
    margin: 12px 24px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--green-dark);
}
.sum-sep { color: var(--green); opacity: .5; }

/* ============================================================
   SCROLL SECTIONS (tarih/saat/paket/masa)
   ============================================================ */
.scroll-section {
    padding: 16px 0 8px;
    border-top: 1px solid var(--border);
    margin: 0 0;
    transition: all .3s;
}
.scroll-section:first-of-type { border-top: none; }
.scroll-section.hidden { display: none; }

.scroll-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--text-muted);
    padding: 0 24px;
    margin-bottom: 10px;
}

.scroll-track-wrap {
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
}

.scroll-arrow {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    color: var(--green);
    transition: all .15s;
    z-index: 2;
    margin: 0 8px;
    flex-shrink: 0;
}
.scroll-arrow:hover { background: var(--green); color: #fff; border-color: var(--green); }
.scroll-arrow:disabled { opacity: .3; cursor: not-allowed; }

.scroll-track {
    display: flex;
    gap: 10px;
    overflow: hidden;              /* gizli scroll */
    scroll-behavior: smooth;
    padding: 6px 0 12px;
    flex: 1;
    /* Scroll snap */
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

/* ============================================================
   SCROLL ITEM KARTLARI
   ============================================================ */
.scroll-item {
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 12px;
    border: 2px solid var(--border);
    background: var(--card);
    transition: all .22s;
    scroll-snap-align: center;
    position: relative;
    user-select: none;
}
.scroll-item:hover {
    border-color: var(--green);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,74,173,.15);
}

/* Seçili öğe */
.scroll-item.selected {
    border-color: var(--green);
    background: var(--green-light);
    box-shadow: 0 0 0 3px var(--green-glow), 0 4px 16px rgba(0,74,173,.2);
}

/* Dolu masa */
.scroll-item.unavailable {
    opacity: .45;
    cursor: not-allowed;
    filter: grayscale(.5);
}
.scroll-item.unavailable:hover {
    transform: none;
    border-color: var(--border);
    box-shadow: none;
}

/* Tarih kartı */
.date-card {
    width: 72px;
    text-align: center;
    padding: 12px 8px;
}
.date-card .day-name { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }
.date-card .day-num  { font-size: 26px; font-weight: 800; color: var(--text); line-height: 1.1; margin: 4px 0; }
.date-card .month    { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.date-card .closed-badge { font-size: 10px; color: var(--danger); font-weight: 700; margin-top: 4px; }

/* Saat kartı */
.time-card {
    width: 72px;
    text-align: center;
    padding: 14px 8px;
    font-size: 17px;
    font-weight: 800;
    color: var(--text);
}

/* Paket kartı */
.pkg-card {
    width: 160px;
    padding: 14px 14px;
}
.pkg-card .pkg-name    { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.pkg-card .pkg-dur     { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.pkg-card .pkg-drinks  { font-size: 11px; color: var(--text-muted); line-height: 1.6; }
.pkg-card .pkg-price   { font-size: 18px; font-weight: 800; color: var(--green); margin-top: 8px; }

/* Masa kartı */
.table-card {
    width: 110px;
    text-align: center;
    padding: 14px 10px;
}
.table-card .tbl-name  { font-size: 16px; font-weight: 800; }
.table-card .tbl-floor { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.table-card .tbl-cap   { font-size: 11px; color: var(--text-muted); }
.table-card .tbl-busy  { font-size: 11px; color: var(--danger); font-weight: 700; margin-top: 4px; }

/* ============================================================
   POPUP FOOTER (onay)
   ============================================================ */
.popup-footer {
    padding: 16px 24px 20px;
    border-top: 1px solid var(--border);
    background: var(--green-light);
    border-radius: 0 0 var(--radius) var(--radius);
}
.reservation-total {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
    line-height: 1.7;
}
.reservation-total strong { color: var(--text); font-size: 15px; }

/* Loading spinner */
.popup-loading {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    z-index: 10;
}
.popup-loading.hidden { display: none; }
.spinner {
    width: 36px; height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   QR CARD
   ============================================================ */
.qr-card { text-align: center; }
.qr-card h2 { font-size: 22px; margin-bottom: 8px; }
.qr-info { margin-top: 12px; font-size: 15px; line-height: 1.8; }

/* ============================================================
   TOGGLE SWITCH
   ============================================================ */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
    margin: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 24px;
    transition: .25s;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    left: 3px; top: 3px;
    width: 18px; height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: .25s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--green); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ============================================================
   SWEETALERT2 FIX
   ============================================================ */
.swal2-input {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0.5em auto !important;
}

/* ============================================================
   PROFİL POPUP
   ============================================================ */
.profile-phone-input {
    background: var(--bg) !important;
    color: var(--text-muted) !important;
    cursor: not-allowed;
}

/* ============================================================
   KURALLAR
   ============================================================ */
.rules-section {
    margin-top: 32px;
    padding: 20px 24px;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    border-left: 4px solid var(--green);
}
.rules-section h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
}
.rules-section ul {
    list-style: none;
    padding: 0;
}
.rules-section li {
    position: relative;
    padding: 6px 0 6px 20px;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}
.rules-section li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--green);
    font-weight: 700;
}

/* ============================================================
   KROKİ (Masa seçimi)
   ============================================================ */
.kroki-toggle {
    font-size: 13px;
    font-weight: 600;
    color: var(--green);
    text-decoration: none;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
}
.kroki-toggle:hover { text-decoration: underline; }
.kroki-wrap {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    padding: 0 24px;
}
.kroki-wrap.open {
    max-height: 500px;
    padding: 8px 24px 12px;
}
.kroki-img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
    .auth-card { padding: 28px 20px; }
    .popup-box { max-height: 95vh; }
    .res-card-top { flex-wrap: wrap; }
    .section-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .date-card { width: 64px; }
    .time-card { width: 64px; }
    .pkg-card  { width: 140px; }
}
