/* Eduvia Randevu — Style CSS
   Theme: Mercan #E07856, Altın #E8A838, Teal #2A9D8F, Krem #FBF8F4
   Font: Plus Jakarta Sans
   Mobile-first, light theme ONLY
*/

:root {
    --coral: #E07856;
    --coral-light: #F2A088;
    --coral-dark: #C85A3A;
    --gold: #E8A838;
    --gold-light: #F5C770;
    --teal: #2A9D8F;
    --teal-light: #6BC4B8;
    --teal-dark: #1E7A6E;
    --cream: #FBF8F4;
    --cream-dark: #F0EBE3;
    --white: #FFFFFF;
    --text: #2D3142;
    --text-light: #6B7280;
    --text-muted: #9CA3AF;
    --border: #E5E0D8;
    --border-light: #F0EBE3;
    --danger: #D64545;
    --danger-light: #FDE8E8;
    --success: #2D9A5A;
    --success-light: #E0F5E9;
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--cream);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ── Navbar ──────────────────────────────────── */

.navbar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.nav-brand a {
    text-decoration: none;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.nav-logo {
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--coral);
    letter-spacing: -0.02em;
}

.nav-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-name {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 600;
}

.nav-link {
    color: var(--coral);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.nav-link:hover {
    background: var(--cream-dark);
}

/* ── Container ────────────────────────────────── */

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}

/* ── Flash messages ─────────────────────────────── */

.flash-messages {
    margin-bottom: 1.5rem;
}

.flash {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.flash-success { background: var(--success-light); color: var(--success); }
.flash-error { background: var(--danger-light); color: var(--danger); }
.flash-warning { background: #FFF8E7; color: #B8860B; }
.flash-info { background: #E7F0FA; color: #2563EB; }

/* ── Auth pages ─────────────────────────────────── */

.auth-wrapper {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-md);
    max-width: 400px;
    width: 100%;
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--coral);
    color: var(--white);
    font-size: 2rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.auth-logo h1 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.auth-subtitle {
    color: var(--text-light);
    font-size: 0.9rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-link {
    color: var(--teal);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}

.auth-link:hover {
    text-decoration: underline;
}

/* ── Forms ─────────────────────────────────────── */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 0.65rem 0.85rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--white);
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--coral);
    box-shadow: 0 0 0 3px rgba(224, 120, 86, 0.12);
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ── Buttons ─────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.25rem;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--coral);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--coral-dark);
}

.btn-teal {
    background: var(--teal);
    color: var(--white);
}

.btn-teal:hover {
    background: var(--teal-dark);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--coral);
    color: var(--coral);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #B83A3A;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 0.85rem;
    font-size: 0.8rem;
}

.btn-xs {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
}

/* ── Page header ──────────────────────────────────── */

.page-header {
    margin-bottom: 1.5rem;
}

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
}

.page-subtitle {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.page-actions {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.back-link {
    display: inline-block;
    margin-top: 0.5rem;
    color: var(--teal);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}

.back-link:hover {
    text-decoration: underline;
}

/* ── Badges ─────────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-right: 0.5rem;
}

.badge-teal { background: var(--teal-light); color: var(--teal-dark); }
.badge-coral { background: var(--coral-light); color: var(--coral-dark); }
.badge-gold { background: var(--gold-light); color: #8A6A1E; }
.badge-muted { background: var(--border-light); color: var(--text-muted); }

/* ── Status badges ─────────────────────────────────── */

.status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.status-booked { background: #FEF3C7; color: #92400E; }
.status-completed { background: var(--success-light); color: var(--success); }
.status-cancelled { background: var(--danger-light); color: var(--danger); }
.status-no_show { background: #F3E8FF; color: #7C3AED; }
.status-available { background: #D1FAE5; color: #065F46; }
.status-inactive { background: var(--border-light); color: var(--text-muted); }
.status-past { background: var(--border-light); color: var(--text-muted); }

/* ── Section ─────────────────────────────────────── */

.section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
}

/* ── Cards ─────────────────────────────────────── */

.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.card-body {
    padding: 1.25rem;
}

.card-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.card-apt {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-link {
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s;
}

.card-link:hover {
    box-shadow: var(--shadow-md);
}

.card-past {
    opacity: 0.65;
}

.card-confirm {
    max-width: 500px;
    margin: 0 auto;
}

/* ── Appointment card content ─────────────────────── */

.apt-date {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
}

.apt-time {
    font-size: 0.85rem;
    color: var(--teal);
    font-weight: 600;
    margin-top: 0.15rem;
}

.apt-parent {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.3rem;
}

.apt-notes {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    font-style: italic;
}

.card-actions {
    padding: 0 1rem 1rem 0;
}

/* ── Slot grid (veli dashboard) ─────────────────────── */

.slot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.slot-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1rem 0.75rem;
    text-decoration: none;
    color: inherit;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.15s, box-shadow 0.15s;
    border: 2px solid transparent;
}

.slot-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--coral);
}

.slot-date {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--coral);
}

.slot-day {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0.15rem 0;
}

.slot-time {
    font-size: 1rem;
    font-weight: 700;
    color: var(--teal);
}

.slot-duration {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* ── Empty state ─────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.95rem;
}

.empty-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ── Stats grid (admin dashboard) ─────────────────── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.25rem 1rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 600;
    margin-top: 0.25rem;
}

.stat-teal .stat-value { color: var(--teal); }
.stat-coral .stat-value { color: var(--coral); }
.stat-gold .stat-value { color: var(--gold); }

/* ── Admin nav ─────────────────────────────────── */

.admin-nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.admin-nav-item {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.25rem 1rem;
    text-decoration: none;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow);
    transition: transform 0.15s;
    font-weight: 600;
    font-size: 0.9rem;
}

.admin-nav-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.nav-icon {
    font-size: 1.5rem;
}

/* ── Table ─────────────────────────────────────── */

.slot-table-wrapper {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.slot-table {
    width: 100%;
    border-collapse: collapse;
}

.slot-table th {
    background: var(--cream-dark);
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.slot-table td {
    padding: 0.85rem 1rem;
    border-top: 1px solid var(--border-light);
    font-size: 0.9rem;
}

.slot-table tr.row-past {
    opacity: 0.6;
}

.slot-table tr:hover {
    background: var(--cream);
}

.cell-date {
    font-weight: 600;
}

.cell-link {
    color: var(--coral);
    text-decoration: none;
    font-weight: 600;
}

.cell-link:hover {
    text-decoration: underline;
}

.row-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ── Filter bar ─────────────────────────────────── */

.filter-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    background: var(--white);
    border: 1.5px solid var(--border);
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s;
}

.filter-chip:hover {
    border-color: var(--coral);
    color: var(--coral);
}

.filter-chip.active {
    background: var(--coral);
    border-color: var(--coral);
    color: var(--white);
}

/* ── Detail page ─────────────────────────────────── */

.detail-section {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border-light);
}

.detail-section:last-child {
    border-bottom: none;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.35rem 0;
    gap: 1rem;
}

.detail-label {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 600;
    flex-shrink: 0;
}

.detail-value {
    font-size: 0.9rem;
    color: var(--text);
    text-align: right;
}

.detail-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}

/* ── Confirm page ─────────────────────────────────── */

.confirm-date {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.confirm-time {
    font-size: 1rem;
    color: var(--teal);
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.confirm-info {
    background: var(--cream);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    margin: 1rem 0;
}

.confirm-info p {
    font-size: 0.85rem;
}

/* ── Weekday grid ─────────────────────────────────── */

.weekday-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.weekday-option {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 0.5rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s;
    background: var(--white);
}

.weekday-option input {
    display: none;
}

.weekday-option input:checked + span {
    color: var(--coral);
}

.weekday-option:has(input:checked) {
    border-color: var(--coral);
    background: rgba(224, 120, 86, 0.08);
}

/* ── Action buttons ─────────────────────────────────── */

.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.buffer-info {
    background: var(--cream);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.85rem;
    margin: 0.5rem 0 1rem;
}

.buffer-info p {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* ── Calendar ─────────────────────────────────────── */

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    background: var(--white);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    box-shadow: var(--shadow);
}

.cal-nav-btn {
    text-decoration: none;
    color: var(--coral);
    font-size: 1.5rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.cal-nav-btn:hover {
    background: var(--cream-dark);
}

.cal-month-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.calendar {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--cream-dark);
}

.cal-weekday {
    text-align: center;
    padding: 0.6rem 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
}

.cal-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-top: 1px solid var(--border-light);
}

.cal-day {
    min-height: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text);
    position: relative;
    border-right: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    transition: background 0.15s;
}

.cal-day:nth-child(7) {
    border-right: none;
}

.cal-day-empty {
    background: var(--cream);
}

.cal-day-num {
    font-size: 0.9rem;
    font-weight: 600;
}

.cal-day-past {
    color: var(--text-muted);
    opacity: 0.5;
}

.cal-day-today {
    background: rgba(42, 157, 143, 0.08);
}

.cal-day-today .cal-day-num {
    color: var(--teal);
    font-weight: 800;
}

.cal-day-available {
    cursor: pointer;
    background: rgba(224, 120, 86, 0.06);
}

.cal-day-available:hover {
    background: rgba(224, 120, 86, 0.15);
}

.cal-day-available .cal-day-num {
    color: var(--coral);
    font-weight: 700;
}

.cal-day-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--coral);
    color: var(--white);
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.cal-day-selected {
    background: rgba(224, 120, 86, 0.2);
    box-shadow: inset 0 0 0 2px var(--coral);
}

.day-slots {
    margin-top: 1.25rem;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
}

.day-slots-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.day-slots-empty {
    color: var(--text-muted);
    text-align: center;
    padding: 1rem;
}

/* ── Footer ─────────────────────────────────────── */

.footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ── Select ─────────────────────────────────────── */

.select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3e%3cpath fill='%236B7280' d='M6 8L2 4h8z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    padding-right: 2.5rem !important;
}

/* ── Responsive ─────────────────────────────────────── */

@media (max-width: 640px) {
    .container {
        padding: 1rem 0.75rem 2rem;
    }

    .navbar {
        padding: 0.6rem 0.75rem;
    }

    .nav-sub {
        display: none;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .admin-nav {
        grid-template-columns: 1fr;
    }

    .slot-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row {
        flex-direction: column;
    }

    .weekday-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Table → card on mobile */
    .slot-table thead {
        display: none;
    }

    .slot-table, .slot-table tbody, .slot-table tr, .slot-table td {
        display: block;
        width: 100%;
    }

    .slot-table tr {
        border-bottom: 1px solid var(--border);
        padding: 0.5rem 0;
    }

    .slot-table td {
        border: none;
        padding: 0.3rem 1rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .slot-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.8rem;
        color: var(--text-light);
    }

    .page-header h2 {
        font-size: 1.25rem;
    }

    .auth-card {
        padding: 2rem 1.5rem;
    }
}