/* =========================================
   Randevularım Page — 2026 Apple Aesthetic
   ========================================= */

:root {
    --ios-bg: #f5f5f7;
    --ios-glass-bg: rgba(255, 255, 255, 0.7);
    --ios-glass-border: rgba(255, 255, 255, 0.4);
    --ios-blur: blur(28px) saturate(180%);
    --ios-shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.04);
    --ios-shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.08);
    --ios-text-primary: #1d1d1f;
    --ios-text-secondary: #86868b;
    --ios-orange: #ff6000;
    --ios-orange-light: rgba(255, 96, 0, 0.1);
    --ios-radius-lg: 24px;
    --ios-radius-md: 16px;
    --ios-radius-sm: 10px;
}

.appointments-page {
    min-height: 100vh;
    background: var(--ios-bg);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ios-text-primary);
    padding-bottom: 4rem;
}

.appointments-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ---- Hero Section ---- */
.appointments-hero {
    position: relative;
    padding: 6rem 0 1rem;
    text-align: center;
    background: linear-gradient(180deg, #ffffff 0%, var(--ios-bg) 100%);
    margin-bottom: 1.5rem;
}



.appt-hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -1px;
    line-height: 1.1;
    margin: 0 0 1rem;
}

.appt-gradient-text {
    background: linear-gradient(135deg, var(--ios-orange), #ff8a3d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.appt-hero-subtitle {
    color: var(--ios-text-secondary);
    font-size: 1.05rem;
    max-width: 440px;
    margin: 0 auto 2.5rem;
    line-height: 1.5;
}



/* ---- Login State ---- */
.appointments-login-required {
    background: var(--ios-glass-bg);
    backdrop-filter: var(--ios-blur);
    -webkit-backdrop-filter: var(--ios-blur);
    border: 1px solid var(--ios-glass-border);
    border-radius: var(--ios-radius-lg);
    padding: 4rem 2rem;
    text-align: center;
    box-shadow: var(--ios-shadow-soft);
    margin-top: 2rem;
}

.login-icon {
    width: 64px;
    height: 64px;
    background: #e8e8ed;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: var(--ios-text-secondary);
}

.login-icon svg { width: 32px; height: 32px; }

.login-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5rem; }
.login-desc { color: var(--ios-text-secondary); font-size: 0.95rem; margin-bottom: 2rem; }

.btn-login-appointments {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--ios-text-primary);
    color: white;
    padding: 0.85rem 2rem;
    border-radius: 30px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.2s;
}

.btn-login-appointments:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

/* ---- Tabs Switcher (iOS Segmented Control) ---- */
.appointments-tabs {
    display: flex;
    background: rgba(227, 227, 232, 0.8);
    backdrop-filter: var(--ios-blur);
    -webkit-backdrop-filter: var(--ios-blur);
    border-radius: 20px;
    padding: 4px;
    margin-bottom: 2rem;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    border-radius: 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ios-text-secondary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.tab-btn svg { width: 16px; height: 16px; }

.tab-btn .tab-count {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(0,0,0,0.06);
    color: inherit;
    transition: all 0.3s;
}

.tab-btn.active {
    background: white;
    color: var(--ios-text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.tab-btn.active .tab-count {
    background: var(--ios-orange);
    color: white;
}

/* Tab Content Transitions */
.tab-content { display: none; }
.tab-content.active {
    display: block;
    animation: fadeSlideUp 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- Date Grouping ---- */
.date-group-header {
    display: flex;
    align-items: center;
    margin: 1.5rem 0 1rem;
}

.date-group-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--ios-text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(0,0,0,0.05);
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
}

.date-group-header::before, .date-group-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(0,0,0,0.04);
}
.date-group-header::before { margin-right: 1rem; }
.date-group-header::after { margin-left: 1rem; }


/* ---- Appointment Card (Glass/Soft Design) ---- */
.appointment-card {
    background: var(--ios-glass-bg);
    backdrop-filter: var(--ios-blur);
    -webkit-backdrop-filter: var(--ios-blur);
    border: 1px solid var(--ios-glass-border);
    border-radius: var(--ios-radius-lg);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--ios-shadow-soft);
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s;
}

.appointment-card:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: var(--ios-shadow-hover);
    border-color: rgba(0,0,0,0.05);
}

.appointment-card:active {
    transform: scale(0.98);
}

/* Header */
.appt-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.appt-firm-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.appt-firm-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--ios-radius-sm);
    background: var(--ios-text-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.appt-firm-icon svg { width: 18px; height: 18px; }

.appt-firm-name {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.15rem;
    color: var(--ios-text-primary);
}

.appt-firm-category {
    font-size: 0.75rem;
    color: var(--ios-text-secondary);
    margin: 0;
}

.appt-status {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Status Colors */
.status-approved { background: rgba(52, 199, 89, 0.15); color: #248a3d; }
.status-pending { background: rgba(255, 149, 0, 0.15); color: #cc7700; }
.status-cancelled { background: rgba(255, 59, 48, 0.15); color: #cc2f26; }
.status-completed { background: rgba(0, 122, 255, 0.15); color: #005ecb; }
.status-default { background: rgba(142, 142, 147, 0.15); color: #5a5a5f; }

/* Body - Services */
.appt-services {
    background: rgba(0, 0, 0, 0.02);
    border-radius: var(--ios-radius-md);
    padding: 0.75rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.appt-service-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.appt-svc-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.appt-svc-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ios-text-secondary);
    opacity: 0.5;
}

.appt-svc-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ios-text-primary);
}

.appt-svc-worker {
    font-size: 0.75rem;
    color: var(--ios-text-secondary);
}

.appt-svc-right {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--ios-text-primary);
}

/* Footer Focus */
.appt-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0,0,0,0.04);
}

.appt-datetime {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.appt-datetime svg {
    width: 16px;
    height: 16px;
    color: var(--ios-text-secondary);
}

.appt-date-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ios-text-primary);
}

.appt-time-text {
    font-size: 0.75rem;
    color: var(--ios-text-secondary);
}

.appt-total {
    text-align: right;
}

.appt-total-amount {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--ios-orange);
}

.appt-discount-badge {
    background: var(--ios-orange-light);
    color: var(--ios-orange);
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    margin-left: 0.25rem;
}

/* ---- Empty State ---- */
.appointments-empty {
    text-align: center;
    padding: 4rem 2rem;
    background: transparent;
}

.empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    background: var(--ios-glass-bg);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ios-orange);
    box-shadow: var(--ios-shadow-soft);
}

.empty-icon svg { width: 32px; height: 32px; }
.empty-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.5rem; }
.empty-desc { color: var(--ios-text-secondary); font-size: 0.9rem; }


/* ---- PAGINATION (Ultra Modern) ---- */
.appt-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0 0;
}

.appt-page-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid transparent;
    background: rgba(0,0,0,0.03);
    color: var(--ios-text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.appt-page-btn:hover:not(:disabled) {
    background: rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.appt-page-btn.active {
    background: var(--ios-text-primary);
    color: white;
    cursor: default;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.appt-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.appt-page-dots {
    color: var(--ios-text-secondary);
    font-weight: 700;
}


/* ---- Bottom Sheet Detail Modal ---- */
.appt-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.appt-sheet-overlay.active {
    opacity: 1;
    visibility: visible;
}

.appt-detail-sheet {
    position: fixed;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: var(--ios-blur);
    -webkit-backdrop-filter: var(--ios-blur);
    border: 1px solid var(--ios-glass-border);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.3, 1);
    overflow-y: auto;
}

@media (max-width: 768px) {
    .appt-detail-sheet {
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 90vh;
        border-radius: 32px 32px 0 0;
        transform: translateY(100%);
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
        padding-bottom: env(safe-area-inset-bottom);
    }
    .appt-detail-sheet.active { transform: translateY(0); }
}

@media (min-width: 769px) {
    .appt-detail-sheet {
        top: 50%;
        left: 50%;
        width: 440px;
        max-height: 85vh;
        border-radius: var(--ios-radius-lg);
        transform: translate(-50%, -46%) scale(0.95);
        opacity: 0;
        box-shadow: 0 30px 60px rgba(0, 0, 0, 0.12);
    }
    .appt-detail-sheet.active {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.sheet-handle {
    display: flex;
    justify-content: center;
    padding: 0.75rem 0;
}

.sheet-handle-bar {
    width: 40px;
    height: 5px;
    background: rgba(0,0,0,0.15);
    border-radius: 3px;
}

@media (min-width: 769px) { .sheet-handle { display: none; } }

.sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1.5rem 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.sheet-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sheet-firm-logo {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--ios-text-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sheet-firm-logo svg { width: 22px; height: 22px; }

.sheet-firm-name { font-size: 1.1rem; font-weight: 700; margin: 0; }
.sheet-firm-cat { font-size: 0.8rem; color: var(--ios-text-secondary); margin: 0; }

.sheet-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--ios-text-secondary);
}

.sheet-close-btn:hover { background: rgba(0,0,0,0.1); }
.sheet-close-btn svg { width: 16px; height: 16px; }

.sheet-body { padding: 1.5rem; }

/* Detail Sub-Components */
.detail-section { margin-bottom: 1.25rem; }

.detail-date-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: rgba(0,0,0,0.03);
    border-radius: 16px;
    margin-bottom: 1.5rem;
}

.detail-date-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ios-orange);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.detail-date-icon svg { width: 20px; height: 20px; }

.detail-date-main { font-size: 0.95rem; font-weight: 700; margin: 0; }
.detail-date-sub { font-size: 0.8rem; color: var(--ios-text-secondary); margin: 0; }

.detail-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--ios-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.detail-service-card {
    background: white;
    border-radius: 14px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.detail-svc-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.detail-svc-name { font-size: 0.9rem; font-weight: 600; margin: 0; }
.detail-svc-price { font-size: 0.95rem; font-weight: 700; color: var(--ios-orange); }

.detail-total-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    background: var(--ios-text-primary);
    color: white;
    border-radius: 16px;
}

.detail-total-label { font-size: 0.9rem; font-weight: 500; opacity: 0.8; }
.detail-total-amount { font-size: 1.4rem; font-weight: 700; }

.detail-note {
    padding: 1rem;
    background: rgba(0,0,0,0.03);
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--ios-text-secondary);
    line-height: 1.5;
}

/* RWD */
@media (max-width: 480px) {
    .appt-hero-title { font-size: 1.8rem; }
    .appt-hero-stats { padding: 0.5rem 0; }
    .appt-stat { padding: 0 1rem; }
    .appt-stat strong { font-size: 1.1rem; }
}
