/* Pole Army - iOS HIG inspired theme */

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    /* iOS System Colors - Light */
    --bg: #F2F2F7;
    --bg-elevated: #FFFFFF;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #E5E5EA;
    --text: #000000;
    --text-secondary: #3C3C43;
    --text-tertiary: #8E8E93;
    --separator: rgba(60, 60, 67, 0.12);
    --border: rgba(60, 60, 67, 0.18);

    --blue: #007AFF;
    --green: #34C759;
    --orange: #FF9500;
    --red: #FF3B30;
    --yellow: #FFCC00;
    --purple: #AF52DE;
    --pink: #FF2D55;
    --indigo: #5856D6;
    --gray: #8E8E93;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

[data-theme="dark"] {
    --bg: #000000;
    --bg-elevated: #1C1C1E;
    --bg-secondary: #1C1C1E;
    --bg-tertiary: #2C2C2E;
    --text: #FFFFFF;
    --text-secondary: #EBEBF5;
    --text-tertiary: #8E8E93;
    --separator: rgba(84, 84, 88, 0.32);
    --border: rgba(84, 84, 88, 0.45);

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
                 "Helvetica Neue", system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    padding-top: var(--safe-area-top);
    padding-bottom: var(--safe-area-bottom);
}

/* ===== Header / Top Bar ===== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-elevated);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 0.5px solid var(--separator);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.topbar-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.4px;
    flex: 1;
    text-align: center;
}

.topbar-actions {
    display: flex;
    gap: 8px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    border-radius: var(--radius-md);
    padding: 10px 16px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.05s;
    text-decoration: none;
    font-family: inherit;
    min-height: 36px;
}

.btn:active { opacity: 0.7; transform: scale(0.98); }

.btn-primary { background: var(--blue); color: #fff; }
.btn-secondary { background: var(--bg-tertiary); color: var(--text); }
.btn-success { background: var(--green); color: #fff; }
.btn-warning { background: var(--orange); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-ghost { background: transparent; color: var(--blue); }

.btn-icon {
    padding: 8px;
    min-width: 36px;
    min-height: 36px;
}

.btn-block { width: 100%; }

/* Top-bar badges (back & logout) */
.badge-btn {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
}
.badge-back { background: var(--blue); color: #fff; }
.badge-logout { background: var(--red); color: #fff; }

/* ===== Hamburger Menu ===== */
.hamburger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    color: var(--text);
}

.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}

.menu-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.menu-drawer {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 78%;
    max-width: 320px;
    background: var(--bg-elevated);
    z-index: 201;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: var(--shadow-lg);
    padding-top: var(--safe-area-top);
    overflow-y: auto;
}

.menu-drawer.open { transform: translateX(0); }

.menu-header {
    padding: 24px 20px 16px;
    border-bottom: 0.5px solid var(--separator);
}

.menu-logo {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.6px;
}

.menu-subtitle {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.menu-list {
    list-style: none;
    padding: 8px 0;
    margin: 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    color: var(--text);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: background 0.15s;
}

.menu-item:hover, .menu-item.active {
    background: var(--bg-tertiary);
}

.menu-item svg {
    width: 22px;
    height: 22px;
    color: var(--blue);
    flex-shrink: 0;
}

.menu-divider {
    height: 0.5px;
    background: var(--separator);
    margin: 8px 0;
}

/* ===== Containers / Layout ===== */
.container {
    padding: 16px;
    max-width: 720px;
    margin: 0 auto;
}

.welcome {
    margin: 8px 0 20px;
}

.welcome-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.8px;
    line-height: 1.15;
}

.welcome-subtitle {
    color: var(--text-tertiary);
    font-size: 15px;
    margin-top: 4px;
}

/* ===== Cards ===== */
.card {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 14px 16px;
    border-bottom: 0.5px solid var(--separator);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
}

.card-body {
    padding: 16px;
}

/* ===== Alert Bars ===== */
.alert {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: 1.4;
}

.alert-warning { background: rgba(255, 149, 0, 0.15); color: var(--text); border: 1px solid rgba(255, 149, 0, 0.3); }
.alert-info    { background: rgba(255, 204, 0, 0.18); color: var(--text); border: 1px solid rgba(255, 204, 0, 0.35); }
.alert-success { background: rgba(52, 199, 89, 0.15); color: var(--text); border: 1px solid rgba(52, 199, 89, 0.3); }
.alert-danger  { background: rgba(255, 59, 48, 0.15); color: var(--text); border: 1px solid rgba(255, 59, 48, 0.3); }

.alert-icon {
    width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px;
}

.alert-content { flex: 1; }
.alert strong { display: block; margin-bottom: 2px; font-weight: 700; }
.alert a { color: var(--blue); text-decoration: none; font-weight: 600; }

/* ===== Date Picker ===== */
.date-strip {
    display: flex;
    gap: 8px;
    background: var(--bg-elevated);
    padding: 12px;
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.date-strip input[type="date"] {
    flex: 1;
    background: var(--bg-tertiary);
    border: none;
    color: var(--text);
    padding: 10px 12px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: inherit;
}

/* ===== Day Group (flashscore-style) ===== */
.day-group { margin-bottom: 20px; }

.day-header {
    background: var(--blue);
    color: #fff;
    padding: 10px 14px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.3px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.day-header-tomorrow { background: var(--indigo); }
.day-header-future { background: var(--bg-tertiary); color: var(--text); }

.day-content {
    background: var(--bg-elevated);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.lesson-row {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 0.5px solid var(--separator);
    cursor: pointer;
    transition: background 0.12s;
    text-decoration: none;
    color: var(--text);
}

.lesson-row:last-child { border-bottom: none; }
.lesson-row:active { background: var(--bg-tertiary); }

.lesson-time {
    font-size: 16px;
    font-weight: 700;
    min-width: 60px;
    font-variant-numeric: tabular-nums;
}

.lesson-info {
    flex: 1;
    margin-left: 12px;
}

.lesson-name { font-size: 16px; font-weight: 600; }

.lesson-meta {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.lesson-status {
    margin-left: 10px;
}

/* Status pills */
.pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.pill-planlandi { background: var(--bg-tertiary); color: var(--text-secondary); }
.pill-geldi    { background: rgba(52, 199, 89, 0.2); color: var(--green); }
.pill-gelmedi  { background: rgba(255, 59, 48, 0.2); color: var(--red); }
.pill-telafi   { background: rgba(255, 204, 0, 0.25); color: #B58900; }

[data-theme="dark"] .pill-telafi { color: #FFCC00; }

.empty {
    padding: 30px 20px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 14px;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 14px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 16px;
    color: var(--text);
    font-family: inherit;
    transition: border-color 0.15s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--blue);
}

.form-row {
    display: flex;
    gap: 10px;
}
.form-row > * { flex: 1; }

/* +/- Stepper */
.stepper {
    display: flex;
    align-items: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    overflow: hidden;
    width: fit-content;
}

.stepper-btn {
    background: transparent;
    border: none;
    width: 44px;
    height: 44px;
    font-size: 22px;
    font-weight: 600;
    color: var(--blue);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stepper-value {
    min-width: 50px;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* ===== Login Page ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px;
    background: var(--bg);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo-title {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -1.2px;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-logo-subtitle {
    font-size: 14px;
    color: var(--text-tertiary);
    margin-top: 6px;
    letter-spacing: 0.3px;
}

.login-card {
    background: var(--bg-elevated);
    border-radius: var(--radius-xl);
    padding: 24px;
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
    box-shadow: var(--shadow-md);
}

/* ===== Modal ===== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 300;
    display: none;
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-backdrop.open { display: flex; }

.modal {
    background: var(--bg-elevated);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 20px 20px calc(20px + var(--safe-area-bottom));
    animation: slideUp 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

@media (min-width: 600px) {
    .modal-backdrop { align-items: center; }
    .modal {
        border-radius: var(--radius-xl);
        max-height: 90vh;
    }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

.modal-handle {
    width: 36px;
    height: 5px;
    background: var(--bg-tertiary);
    border-radius: 999px;
    margin: 0 auto 16px;
}

.modal-title {
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 4px;
}

.modal-subtitle {
    font-size: 14px;
    color: var(--text-tertiary);
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-btn {
    width: 100%;
    padding: 16px;
    border-radius: var(--radius-md);
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.modal-btn-geldi   { background: var(--green); color: #fff; }
.modal-btn-telafi  { background: var(--orange); color: #fff; }
.modal-btn-gelmedi { background: var(--red); color: #fff; }
.modal-btn-iptal   { background: var(--bg-tertiary); color: var(--text); }

/* ===== Tables (simple, mobile-friendly) ===== */
.list {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.list-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 0.5px solid var(--separator);
    text-decoration: none;
    color: var(--text);
    transition: background 0.12s;
}

.list-item:last-child { border-bottom: none; }
.list-item:active { background: var(--bg-tertiary); }

.list-item-content { flex: 1; }
.list-item-title { font-size: 16px; font-weight: 600; }
.list-item-subtitle { font-size: 13px; color: var(--text-tertiary); margin-top: 2px; }
.list-item-chevron { color: var(--text-tertiary); }

/* ===== Theme Toggle ===== */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text);
    padding: 8px;
    border-radius: 8px;
}

/* ===== Floating action button ===== */
.fab {
    position: fixed;
    bottom: calc(20px + var(--safe-area-bottom));
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.fab svg { width: 26px; height: 26px; }

/* ===== Misc ===== */
.text-muted { color: var(--text-tertiary); }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 12px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

.hidden { display: none !important; }

/* Sektion header */
.section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    margin: 16px 4px 8px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: calc(80px + var(--safe-area-bottom));
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 12px 20px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    z-index: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    backdrop-filter: blur(20px);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Footer */
.footer {
    text-align: center;
    padding: 24px 16px calc(24px + var(--safe-area-bottom));
    color: var(--text-tertiary);
    font-size: 12px;
}
