/* ============================================
   Bay Brothers OS - iOS Native Calendar
   Pixel-perfect iOS Calendar app clone
   ============================================ */

/* ============ IOS CALENDAR CONTAINER ============ */
.ios-calendar-container {
    background: var(--bb-bg-primary, #ffffff);
    min-height: 100vh;
    /* CRITICAL: Do NOT add padding-top here - it's handled by .page in mobile-core.css
       Adding padding here causes double padding in PWA mode */
}

[data-bs-theme="dark"] .ios-calendar-container {
    background: var(--bb-bg-primary, #000000);
}

/* ============ IOS CALENDAR MONTH VIEW ============ */
.ios-calendar-month {
    background: var(--bb-bg-primary, #ffffff);
    border-radius: 0 0 20px 20px;
    overflow: hidden;
}

[data-bs-theme="dark"] .ios-calendar-month {
    background: var(--bb-bg-primary, #000000);
}

/* Month Header */
.ios-cal-month-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 8px;
    background: var(--bb-bg-primary, #ffffff);
}

[data-bs-theme="dark"] .ios-cal-month-header {
    background: var(--bb-bg-primary, #000000);
}

.ios-cal-year {
    font-size: 13px;
    font-weight: 400;
    color: var(--bb-text-secondary, #8E8E93);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    width: 100%;
}

.ios-cal-month-name {
    font-size: 34px;
    font-weight: 700;
    color: var(--bb-text-primary, #000000);
    letter-spacing: -0.5px;
    line-height: 1.1;
    text-align: center;
    width: 100%;
}

[data-bs-theme="dark"] .ios-cal-month-name {
    color: var(--bb-text-primary, #ffffff);
}

.ios-cal-nav-container {
    display: flex;
    gap: 4px;
    position: absolute;
    right: 16px;
}

.ios-cal-nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--bb-primary, #007AFF);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.ios-cal-nav-btn:active {
    background: var(--bb-bg-secondary, rgba(0, 122, 255, 0.1));
    transform: scale(0.9);
}

[data-bs-theme="dark"] .ios-cal-nav-btn {
    color: var(--bb-primary, #0A84FF);
}

[data-bs-theme="dark"] .ios-cal-nav-btn:active {
    background: rgba(10, 132, 255, 0.15);
}

/* Weekday Headers */
.ios-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 8px 4px 4px;
    background: var(--bb-bg-primary, #ffffff);
}

[data-bs-theme="dark"] .ios-cal-weekdays {
    background: var(--bb-bg-primary, #000000);
}

.ios-cal-weekday {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--bb-text-tertiary, #C7C7CC);
    padding: 4px 0;
    letter-spacing: 0.3px;
}

/* Calendar Days Grid */
.ios-cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 0 4px 12px;
    gap: 0;
    background: var(--bb-bg-primary, #ffffff);
}

[data-bs-theme="dark"] .ios-cal-days {
    background: var(--bb-bg-primary, #000000);
}

.ios-cal-day {
    aspect-ratio: 1;
    border: none;
    background: transparent;
    color: var(--bb-text-primary, #000000);
    font-size: 17px;
    font-weight: 400;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    padding: 2px;
}

.ios-cal-day:active:not(.disabled) {
    opacity: 0.6;
}

[data-bs-theme="dark"] .ios-cal-day {
    color: var(--bb-text-primary, #ffffff);
}

/* Day Number Circle */
.ios-cal-day-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    position: relative;
}

/* Other month days */
.ios-cal-day.other-month {
    opacity: 0.3;
}

/* Disabled (past) days */
.ios-cal-day.disabled {
    opacity: 0.25;
    cursor: not-allowed;
    pointer-events: none;
}

/* Today */
.ios-cal-day.today .ios-cal-day-circle {
    background: var(--bb-bg-secondary, #F2F2F7);
    font-weight: 600;
}

[data-bs-theme="dark"] .ios-cal-day.today .ios-cal-day-circle {
    background: var(--bb-bg-tertiary, #2C2C2E);
}

/* Selected Day - Exactly like iOS */
.ios-cal-day.selected .ios-cal-day-circle {
    background: var(--bb-primary, #007AFF);
    color: #ffffff;
    font-weight: 600;
    transform: scale(1.05);
}

[data-bs-theme="dark"] .ios-cal-day.selected .ios-cal-day-circle {
    background: var(--bb-primary, #0A84FF);
}

/* Event Dots - iOS Style */
.ios-cal-day-dots {
    display: flex;
    gap: 2px;
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
}

.ios-cal-day-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--bb-primary, #007AFF);
}

.ios-cal-day.selected .ios-cal-day-dot {
    background: #ffffff;
}

[data-bs-theme="dark"] .ios-cal-day-dot {
    background: var(--bb-primary, #0A84FF);
}

/* ============ IOS TIME LIST VIEW ============ */
.ios-time-list-container {
    background: var(--bb-bg-secondary, #F2F2F7);
    border-top: 1px solid var(--bb-border-color, rgba(0, 0, 0, 0.1));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    /* CRITICAL: Allow scroll events to work immediately */
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
    position: relative;
    /* Fix iOS Safari scroll blocking */
    touch-action: pan-y;
    overscroll-behavior-y: contain;
}

[data-bs-theme="dark"] .ios-time-list-container {
    background: var(--bb-bg-primary, #000000);
    border-top-color: rgba(255, 255, 255, 0.1);
}

/* Selected Date Header */
.ios-selected-date-header {
    background: var(--bb-bg-primary, #ffffff);
    padding: 12px 20px 8px;
    border-bottom: 1px solid var(--bb-border-color, rgba(0, 0, 0, 0.1));
}

[data-bs-theme="dark"] .ios-selected-date-header {
    background: var(--bb-bg-primary, #000000);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.ios-selected-date-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--bb-text-secondary, #8E8E93);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.ios-selected-date-display {
    font-size: 18px;
    font-weight: 700;
    color: var(--bb-text-primary, #000000);
    letter-spacing: -0.3px;
}

[data-bs-theme="dark"] .ios-selected-date-display {
    color: var(--bb-text-primary, #ffffff);
}

/* Time Period Groups */
.ios-time-period {
    margin-bottom: 4px;
    /* CRITICAL: Prevent scroll blocking */
    touch-action: pan-y;
    position: relative;
}

.ios-time-period-header {
    font-size: 11px;
    font-weight: 700;
    color: var(--bb-text-secondary, #8E8E93);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 8px 20px 4px;
    background: var(--bb-bg-secondary, #F2F2F7);
    /* Prevent header from blocking scroll events */
    pointer-events: none;
}

[data-bs-theme="dark"] .ios-time-period-header {
    background: var(--bb-bg-primary, #000000);
}

/* Time Slot Items - iOS List Style */
.ios-time-list {
    background: var(--bb-bg-primary, #ffffff);
    border-radius: 10px;
    margin: 0 12px 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    /* CRITICAL: Fix touch scrolling */
    touch-action: pan-y;
    position: relative;
}

[data-bs-theme="dark"] .ios-time-list {
    background: var(--bb-bg-secondary, #1C1C1E);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.ios-time-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--bb-border-color, rgba(0, 0, 0, 0.05));
    background: transparent;
    border-left: none;
    border-right: none;
    border-top: none;
    width: 100%;
    cursor: pointer;
    transition: background-color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    min-height: 44px;
    /* CRITICAL: Allow parent to handle scrolling */
    touch-action: inherit;
    position: relative;
}

.ios-time-item:last-child {
    border-bottom: none;
}

.ios-time-item:active:not(.unavailable) {
    background-color: var(--bb-bg-secondary, #F2F2F7);
}

[data-bs-theme="dark"] .ios-time-item:active:not(.unavailable) {
    background-color: var(--bb-bg-tertiary, #2C2C2E);
}

/* Radio Circle - iOS Style */
.ios-time-radio {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--bb-border-color, #C7C7CC);
    background: transparent;
    margin-right: 12px;
    flex-shrink: 0;
    position: relative;
    transition: all 0.2s ease;
}

.ios-time-item.selected .ios-time-radio {
    border-color: var(--bb-primary, #007AFF);
    background: var(--bb-primary, #007AFF);
}

.ios-time-item.selected .ios-time-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffffff;
}

[data-bs-theme="dark"] .ios-time-radio {
    border-color: #48484A;
}

[data-bs-theme="dark"] .ios-time-item.selected .ios-time-radio {
    border-color: var(--bb-primary, #0A84FF);
    background: var(--bb-primary, #0A84FF);
}

/* Time Display */
.ios-time-display {
    flex: 1;
}

.ios-time-value {
    font-size: 17px;
    font-weight: 400;
    color: var(--bb-text-primary, #000000);
    letter-spacing: -0.2px;
}

.ios-time-item.selected .ios-time-value {
    font-weight: 600;
    color: var(--bb-primary, #007AFF);
}

.ios-time-item.unavailable .ios-time-value {
    color: var(--bb-text-tertiary, #C7C7CC);
}

[data-bs-theme="dark"] .ios-time-value {
    color: var(--bb-text-primary, #ffffff);
}

[data-bs-theme="dark"] .ios-time-item.selected .ios-time-value {
    color: var(--bb-primary, #0A84FF);
}

[data-bs-theme="dark"] .ios-time-item.unavailable .ios-time-value {
    color: var(--bb-text-tertiary, #48484A);
}

/* Status Indicator */
.ios-time-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    margin-left: auto;
    padding-left: 12px;
}

.ios-time-status.available {
    color: #34C759;
}

.ios-time-status.conflict {
    color: #FFCC00;
}

.ios-time-status.unavailable {
    color: var(--bb-text-tertiary, #C7C7CC);
}

[data-bs-theme="dark"] .ios-time-status.available {
    color: #30D158;
}

[data-bs-theme="dark"] .ios-time-status.conflict {
    color: #FFD60A;
}

.ios-time-status i {
    font-size: 16px;
}

/* Unavailable Time Slot */
.ios-time-item.unavailable {
    opacity: 0.4;
    cursor: not-allowed;
}

.ios-time-item.unavailable .ios-time-radio {
    border-color: var(--bb-text-tertiary, #C7C7CC);
}

/* Conflict Time Slot */
.ios-time-item.conflict {
    background: linear-gradient(90deg, transparent, rgba(255, 204, 0, 0.05), transparent);
}

[data-bs-theme="dark"] .ios-time-item.conflict {
    background: linear-gradient(90deg, transparent, rgba(255, 214, 10, 0.08), transparent);
}

/* ============ IOS TODAY BUTTON ============ */
.ios-today-button {
    position: fixed;
    bottom: max(80px, calc(80px + env(safe-area-inset-bottom)));
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--bb-primary, #007AFF);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.4);
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.ios-today-button:active {
    transform: scale(0.92);
}

[data-bs-theme="dark"] .ios-today-button {
    background: var(--bb-primary, #0A84FF);
    box-shadow: 0 4px 16px rgba(10, 132, 255, 0.4);
}

.ios-today-month {
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: rgba(255, 255, 255, 0.8);
}

.ios-today-day {
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
}

/* ============ IOS CALENDAR DAY STATES ============ */

/* Hover effect on desktop */
@media (hover: hover) {
    .ios-cal-day:not(.disabled):not(.selected):hover .ios-cal-day-circle {
        background: var(--bb-bg-secondary, #F2F2F7);
    }
    
    [data-bs-theme="dark"] .ios-cal-day:not(.disabled):not(.selected):hover .ios-cal-day-circle {
        background: var(--bb-bg-tertiary, #2C2C2E);
    }
}

/* ============ IOS DIVIDER ============ */
.ios-divider {
    height: 8px;
    background: var(--bb-bg-secondary, #F2F2F7);
    border-top: 1px solid var(--bb-border-color, rgba(0, 0, 0, 0.05));
    border-bottom: 1px solid var(--bb-border-color, rgba(0, 0, 0, 0.05));
}

[data-bs-theme="dark"] .ios-divider {
    background: var(--bb-bg-primary, #000000);
    border-top-color: rgba(255, 255, 255, 0.05);
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

/* ============ IOS EMPTY STATE ============ */
.ios-time-empty {
    text-align: center;
    padding: 60px 20px;
    background: var(--bb-bg-primary, #ffffff);
    border-radius: 12px;
    margin: 0 16px 16px;
}

[data-bs-theme="dark"] .ios-time-empty {
    background: var(--bb-bg-secondary, #1C1C1E);
}

.ios-time-empty-icon {
    font-size: 48px;
    color: var(--bb-text-tertiary, #C7C7CC);
    opacity: 0.5;
    margin-bottom: 12px;
}

.ios-time-empty-text {
    font-size: 17px;
    color: var(--bb-text-secondary, #8E8E93);
    margin: 0;
}

/* ============ IOS CONTINUE BUTTON ============ */
.ios-continue-bar {
    position: sticky;
    bottom: 0;
    background: var(--bb-bg-primary, #ffffff);
    border-top: 1px solid var(--bb-border-color, rgba(0, 0, 0, 0.1));
    padding: 12px 16px;
    padding-bottom: max(12px, calc(12px + env(safe-area-inset-bottom)));
    z-index: 10;
}

[data-bs-theme="dark"] .ios-continue-bar {
    background: var(--bb-bg-primary, #000000);
    border-top-color: rgba(255, 255, 255, 0.1);
}

.ios-continue-button {
    width: 100%;
    min-height: 50px;
    background: var(--bb-primary, #007AFF);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ios-continue-button:active:not(:disabled) {
    transform: scale(0.98);
    opacity: 0.8;
}

.ios-continue-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

[data-bs-theme="dark"] .ios-continue-button {
    background: var(--bb-primary, #0A84FF);
}

/* ============ IOS ANIMATIONS ============ */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.ios-time-list-container {
    animation: slideInUp 0.3s ease;
}

.ios-time-item {
    animation: fadeIn 0.2s ease backwards;
}

.ios-time-item:nth-child(1) { animation-delay: 0.02s; }
.ios-time-item:nth-child(2) { animation-delay: 0.04s; }
.ios-time-item:nth-child(3) { animation-delay: 0.06s; }
.ios-time-item:nth-child(4) { animation-delay: 0.08s; }
.ios-time-item:nth-child(5) { animation-delay: 0.10s; }

/* ============ SMOOTH SCROLLING ============ */
.ios-time-list-scroll {
    /* COMPACT HEIGHT: Fits on phone screen with calendar + buttons visible
       Shows approximately 3-4 time slots at once, similar to iOS time picker */
    max-height: 180px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    /* CRITICAL: Fix iOS Safari scroll delay issue */
    touch-action: pan-y;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    /* Force immediate scroll response */
    overscroll-behavior-y: contain;
    /* Ensure proper layer stacking */
    position: relative;
    z-index: 1;
}

/* Slightly taller on larger phones */
@media (min-height: 700px) {
    .ios-time-list-scroll {
        max-height: 200px;
    }
}

/* Even taller on Pro Max size phones */
@media (min-height: 800px) {
    .ios-time-list-scroll {
        max-height: 240px;
    }
}

/* Hide scrollbar but keep functionality */
.ios-time-list-scroll::-webkit-scrollbar {
    width: 0;
    background: transparent;
}

/* ============ MONTH TRANSITION ============ */
.ios-calendar-month {
    transition: opacity 0.2s ease, transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.ios-calendar-month.transitioning {
    opacity: 0.3;
    transform: scale(0.98);
}

/* ============ SELECTED DAY ANIMATION ============ */
@keyframes selectDay {
    0% {
        transform: scale(1);
    }
    40% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1.05);
    }
}

.ios-cal-day.selected .ios-cal-day-circle {
    animation: selectDay 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Ripple effect on tap */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.ios-cal-day::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: var(--bb-primary, #007AFF);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    pointer-events: none;
}

.ios-cal-day:active:not(.disabled)::before {
    animation: ripple 0.6s ease-out;
}

/* ============ NO TIMES AVAILABLE MESSAGE ============ */
.ios-no-times-card {
    background: var(--bb-bg-primary, #ffffff);
    border-radius: 12px;
    margin: 16px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-bs-theme="dark"] .ios-no-times-card {
    background: var(--bb-bg-secondary, #1C1C1E);
}

.ios-no-times-icon {
    font-size: 56px;
    color: var(--bb-text-tertiary, #C7C7CC);
    margin-bottom: 12px;
    opacity: 0.6;
}

.ios-no-times-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--bb-text-primary, #000000);
    margin-bottom: 8px;
}

[data-bs-theme="dark"] .ios-no-times-title {
    color: var(--bb-text-primary, #ffffff);
}

.ios-no-times-message {
    font-size: 15px;
    color: var(--bb-text-secondary, #8E8E93);
    line-height: 1.5;
}

/* ============ RESPONSIVE ADJUSTMENTS ============ */
@media (max-width: 374px) {
    /* iPhone SE */
    .ios-cal-day-circle {
        width: 28px;
        height: 28px;
        font-size: 15px;
    }
    
    .ios-cal-month-name {
        font-size: 28px;
    }
    
    .ios-selected-date-display {
        font-size: 20px;
    }
}

@media (min-width: 375px) and (max-width: 414px) {
    /* iPhone Standard */
    .ios-cal-day-circle {
        width: 32px;
        height: 32px;
    }
}

@media (min-width: 415px) {
    /* iPhone Plus / Pro Max */
    .ios-cal-day-circle {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
}

/* ============ LANDSCAPE MODE ============ */
@media (max-width: 767px) and (orientation: landscape) {
    .ios-calendar-month {
        max-height: 50vh;
    }
    
    .ios-time-list-scroll {
        max-height: calc(50vh - 120px);
    }
    
    .ios-cal-month-name {
        font-size: 24px;
    }
}

/* ============ ACCESSIBILITY ============ */
@media (prefers-reduced-motion: reduce) {
    .ios-cal-day-circle,
    .ios-time-item,
    .ios-calendar-month,
    .ios-continue-button {
        animation: none !important;
        transition: none !important;
    }
}

/* ============ FOCUS STATES ============ */
.ios-cal-day:focus,
.ios-time-item:focus,
.ios-cal-nav-btn:focus {
    outline: 2px solid var(--bb-primary, #007AFF);
    outline-offset: 2px;
}

[data-bs-theme="dark"] .ios-cal-day:focus,
[data-bs-theme="dark"] .ios-time-item:focus,
[data-bs-theme="dark"] .ios-cal-nav-btn:focus {
    outline-color: var(--bb-primary, #0A84FF);
}

/* ============ LOADING STATE ============ */
.ios-time-loading {
    text-align: center;
    padding: 40px 20px;
    background: var(--bb-bg-primary, #ffffff);
    border-radius: 12px;
    margin: 16px;
}

[data-bs-theme="dark"] .ios-time-loading {
    background: var(--bb-bg-secondary, #1C1C1E);
}

.ios-time-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--bb-bg-tertiary, #E5E5EA);
    border-top-color: var(--bb-primary, #007AFF);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

[data-bs-theme="dark"] .ios-time-loading-spinner {
    border-color: var(--bb-bg-tertiary, #2C2C2E);
    border-top-color: var(--bb-primary, #0A84FF);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.ios-time-loading-text {
    font-size: 15px;
    color: var(--bb-text-secondary, #8E8E93);
}

/* ============ COMPACT CALENDAR MODE ============ */
.ios-calendar-compact .ios-cal-month-name {
    font-size: 20px;
}

.ios-calendar-compact .ios-cal-day-circle {
    width: 28px;
    height: 28px;
    font-size: 15px;
}

.ios-calendar-compact .ios-cal-weekday {
    font-size: 10px;
}

/* ============ SELECTED DATE BADGE ============ */
.ios-selected-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bb-bg-secondary, #F2F2F7);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 15px;
    font-weight: 600;
    color: var(--bb-text-primary, #000000);
    margin-top: 8px;
}

[data-bs-theme="dark"] .ios-selected-badge {
    background: var(--bb-bg-tertiary, #2C2C2E);
    color: var(--bb-text-primary, #ffffff);
}

.ios-selected-badge i {
    font-size: 18px;
    color: var(--bb-primary, #007AFF);
}

[data-bs-theme="dark"] .ios-selected-badge i {
    color: var(--bb-primary, #0A84FF);
}

/* ============ TIME SLOT WITH EVENT PREVIEW ============ */
.ios-time-event-preview {
    margin-left: 34px;
    margin-top: 4px;
    font-size: 13px;
    color: var(--bb-text-secondary, #8E8E93);
    display: flex;
    align-items: center;
    gap: 6px;
}

.ios-time-event-preview i {
    font-size: 12px;
}

/* ============ MONTH YEAR SELECTOR (FUTURE) ============ */
.ios-month-selector {
    background: var(--bb-bg-primary, #ffffff);
    position: relative;
}

[data-bs-theme="dark"] .ios-month-selector {
    background: var(--bb-bg-primary, #000000);
}

/* ============ SAFE AREA PADDING ============ */
@supports (padding: max(0px)) {
    /* NOTE: ios-calendar-container padding-top is handled by .is-pwa .page in mobile-core.css
       Do NOT add padding-top here as it causes double padding in PWA mode */
    
    .ios-continue-bar {
        padding-bottom: max(12px, calc(12px + env(safe-area-inset-bottom)));
    }
}

/* ============ PERFORMANCE OPTIMIZATIONS ============ */
.ios-cal-day,
.ios-time-item,
.ios-cal-nav-btn,
.ios-continue-button {
    will-change: transform, opacity;
}

/* ============ IOS FORM STYLES ============ */
.ios-form-group {
    background: var(--bb-bg-primary, #ffffff);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

[data-bs-theme="dark"] .ios-form-group {
    background: var(--bb-bg-secondary, #1C1C1E);
}

.ios-form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--bb-border-color, rgba(0, 0, 0, 0.08));
    background: transparent;
    border-left: none;
    border-right: none;
    border-top: none;
    width: 100%;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
    gap: 12px;
    min-height: 54px;
}

.ios-form-row:last-child {
    border-bottom: none;
}

.ios-form-row.clickable {
    cursor: pointer;
    transition: background 0.15s ease;
}

.ios-form-row.clickable:active {
    background: var(--bb-bg-secondary, rgba(0, 0, 0, 0.03));
}

.ios-form-row.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

[data-bs-theme="dark"] .ios-form-row {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .ios-form-row.clickable:active {
    background: rgba(255, 255, 255, 0.05);
}

.ios-form-label {
    font-size: 16px;
    font-weight: 500;
    color: var(--bb-text-primary, #000000);
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.ios-form-label i {
    color: var(--bb-primary, #007AFF);
    font-size: 18px;
}

[data-bs-theme="dark"] .ios-form-label {
    color: var(--bb-text-primary, #ffffff);
}

[data-bs-theme="dark"] .ios-form-label i {
    color: var(--bb-primary, #0A84FF);
}

.ios-form-value {
    font-size: 16px;
    font-weight: 400;
    color: var(--bb-text-primary, #000000);
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ios-form-value span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ios-form-value.readonly {
    color: var(--bb-text-secondary, #8E8E93);
}

.ios-form-value .text-muted {
    color: var(--bb-text-tertiary, #C7C7CC) !important;
    font-weight: 400;
}

[data-bs-theme="dark"] .ios-form-value {
    color: var(--bb-text-primary, #ffffff);
}

[data-bs-theme="dark"] .ios-form-value .text-muted {
    color: var(--bb-text-tertiary, #48484A) !important;
}

.ios-form-section-header {
    font-size: 12px;
    font-weight: 700;
    color: var(--bb-text-secondary, #8E8E93);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 20px 16px 8px;
}

.ios-textarea-container {
    background: var(--bb-bg-primary, #ffffff);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

[data-bs-theme="dark"] .ios-textarea-container {
    background: var(--bb-bg-secondary, #1C1C1E);
}

.ios-textarea {
    width: 100%;
    border: none;
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 400;
    color: var(--bb-text-primary, #000000);
    background: transparent;
    resize: vertical;
    min-height: 100px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
}

.ios-textarea:focus {
    outline: none;
}

.ios-textarea::placeholder {
    color: var(--bb-text-tertiary, #C7C7CC);
}

[data-bs-theme="dark"] .ios-textarea {
    color: var(--bb-text-primary, #ffffff);
}

[data-bs-theme="dark"] .ios-textarea::placeholder {
    color: var(--bb-text-tertiary, #48484A);
}

/* ============ FINAL SUMMARY CARD ============ */
.ios-final-summary-card {
    background: var(--bb-bg-primary, #ffffff);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-bs-theme="dark"] .ios-final-summary-card {
    background: var(--bb-bg-secondary, #1C1C1E);
}

.ios-final-summary-header {
    background: #34C759;
    color: #ffffff;
    padding: 14px 16px;
    font-size: 17px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

[data-bs-theme="dark"] .ios-final-summary-header {
    background: #30D158;
}

.ios-final-summary-body {
    padding: 0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--bb-border-color, rgba(0, 0, 0, 0.05));
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-row.highlight {
    background: rgba(52, 199, 89, 0.08);
}

[data-bs-theme="dark"] .summary-row {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .summary-row.highlight {
    background: rgba(48, 209, 88, 0.12);
}

.summary-label {
    font-size: 17px;
    color: var(--bb-text-primary, #000000);
}

.summary-value {
    font-size: 17px;
    font-weight: 600;
    color: var(--bb-text-primary, #000000);
    text-align: right;
}

.summary-row.highlight .summary-value {
    color: #34C759;
    font-size: 20px;
}

[data-bs-theme="dark"] .summary-label {
    color: var(--bb-text-primary, #ffffff);
}

[data-bs-theme="dark"] .summary-value {
    color: var(--bb-text-primary, #ffffff);
}

[data-bs-theme="dark"] .summary-row.highlight .summary-value {
    color: #30D158;
}

/* ============ IOS HEADER ACTION BUTTON ============ */
.ios-header-action {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--bb-primary, #007AFF);
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.ios-header-action:active {
    transform: scale(0.9);
    opacity: 0.7;
}

[data-bs-theme="dark"] .ios-header-action {
    color: var(--bb-primary, #0A84FF);
}

/* ============ IOS CALENDAR SECTION HEADER ============ */
.ios-cal-section-header {
    background: var(--bb-bg-secondary, #F2F2F7);
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 700;
    color: var(--bb-text-secondary, #8E8E93);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-top: 1px solid var(--bb-border-color, rgba(0, 0, 0, 0.05));
}

[data-bs-theme="dark"] .ios-cal-section-header {
    background: var(--bb-bg-primary, #000000);
    border-top-color: rgba(255, 255, 255, 0.05);
}

/* ============ IOS HEADER WITH SAFE AREA ============ */
.ios-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bb-bg-primary, #ffffff);
    border-bottom: 1px solid var(--bb-border-color, rgba(0, 0, 0, 0.1));
    padding-top: env(safe-area-inset-top);
}

[data-bs-theme="dark"] .ios-header {
    background: var(--bb-bg-primary, #000000);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.ios-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    min-height: 44px;
}

.ios-header-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--bb-text-primary, #000000);
    text-align: center;
    flex: 1;
    margin: 0;
}

[data-bs-theme="dark"] .ios-header-title {
    color: var(--bb-text-primary, #ffffff);
}

.ios-header-spacer {
    width: 60px;
}

.ios-back-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    color: var(--bb-primary, #007AFF);
    font-size: 17px;
    font-weight: 400;
    padding: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    min-width: 60px;
}

.ios-back-btn:active {
    opacity: 0.6;
}

.ios-back-btn i {
    font-size: 22px;
}

[data-bs-theme="dark"] .ios-back-btn {
    color: var(--bb-primary, #0A84FF);
}

/* ============ IOS SUMMARY CARD ============ */
.ios-summary-card {
    background: var(--bb-bg-primary, #ffffff);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    position: relative;
}

[data-bs-theme="dark"] .ios-summary-card {
    background: var(--bb-bg-secondary, #1C1C1E);
}

.ios-summary-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--bb-text-secondary, #8E8E93);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}

.ios-summary-value {
    font-size: 16px;
    font-weight: 500;
    color: var(--bb-text-primary, #000000);
    line-height: 1.5;
}

[data-bs-theme="dark"] .ios-summary-value {
    color: var(--bb-text-primary, #ffffff);
}

.ios-summary-change {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--bb-bg-secondary, rgba(0, 122, 255, 0.1));
    border: none;
    color: var(--bb-primary, #007AFF);
    font-size: 14px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s ease;
}

.ios-summary-change:active {
    opacity: 0.7;
    transform: scale(0.95);
}

[data-bs-theme="dark"] .ios-summary-change {
    color: var(--bb-primary, #0A84FF);
    background: rgba(10, 132, 255, 0.15);
}

/* ============ IOS SERVICE CARDS ============ */
.ios-service-card {
    background: var(--bb-bg-primary, #ffffff);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

[data-bs-theme="dark"] .ios-service-card {
    background: var(--bb-bg-secondary, #1C1C1E);
}

.ios-service-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bb-bg-secondary, #F9F9F9);
    border-bottom: 1px solid var(--bb-border-color, rgba(0, 0, 0, 0.05));
}

[data-bs-theme="dark"] .ios-service-card-header {
    background: var(--bb-bg-tertiary, #2C2C2E);
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.ios-service-card-number {
    font-size: 13px;
    font-weight: 700;
    color: var(--bb-primary, #007AFF);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

[data-bs-theme="dark"] .ios-service-card-number {
    color: var(--bb-primary, #0A84FF);
}

.ios-service-card-body {
    padding: 16px;
}

.ios-service-name {
    font-size: 17px;
    font-weight: 600;
    color: var(--bb-text-primary, #000000);
    margin-bottom: 4px;
}

[data-bs-theme="dark"] .ios-service-name {
    color: var(--bb-text-primary, #ffffff);
}

.ios-service-desc {
    font-size: 15px;
    color: var(--bb-text-secondary, #8E8E93);
    margin-bottom: 16px;
}

.ios-delete-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: #FF3B30;
    font-size: 15px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease;
}

.ios-delete-btn:active {
    background: rgba(255, 59, 48, 0.1);
}

[data-bs-theme="dark"] .ios-delete-btn {
    color: #FF453A;
}

[data-bs-theme="dark"] .ios-delete-btn:active {
    background: rgba(255, 69, 58, 0.15);
}

.ios-add-service-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    border: 2px dashed var(--bb-border-color, #C7C7CC);
    border-radius: 12px;
    padding: 16px;
    color: var(--bb-primary, #007AFF);
    font-size: 17px;
    font-weight: 500;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s ease;
}

.ios-add-service-btn:active {
    background: var(--bb-bg-secondary, #F2F2F7);
    border-color: var(--bb-primary, #007AFF);
}

[data-bs-theme="dark"] .ios-add-service-btn {
    border-color: var(--bb-text-tertiary, #48484A);
    color: var(--bb-primary, #0A84FF);
}

[data-bs-theme="dark"] .ios-add-service-btn:active {
    background: var(--bb-bg-tertiary, #2C2C2E);
    border-color: var(--bb-primary, #0A84FF);
}

.ios-field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--bb-text-secondary, #8E8E93);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.ios-input {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    font-size: 16px;
    font-weight: 400;
    color: var(--bb-text-primary, #000000);
    background: var(--bb-bg-secondary, #F2F2F7);
    border: 1px solid transparent;
    border-radius: 10px;
    transition: all 0.2s ease;
    -webkit-appearance: none;
}

.ios-input:focus {
    outline: none;
    border-color: var(--bb-primary, #007AFF);
    background: var(--bb-bg-primary, #ffffff);
}

.ios-input::placeholder {
    color: var(--bb-text-tertiary, #C7C7CC);
}

[data-bs-theme="dark"] .ios-input {
    color: var(--bb-text-primary, #ffffff);
    background: var(--bb-bg-tertiary, #2C2C2E);
}

[data-bs-theme="dark"] .ios-input:focus {
    border-color: var(--bb-primary, #0A84FF);
    background: var(--bb-bg-secondary, #1C1C1E);
}

[data-bs-theme="dark"] .ios-input::placeholder {
    color: var(--bb-text-tertiary, #48484A);
}

.ios-input-addon {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 16px;
    font-weight: 500;
    color: var(--bb-text-secondary, #8E8E93);
    background: var(--bb-bg-secondary, #F2F2F7);
    border: 1px solid transparent;
    border-radius: 10px 0 0 10px;
}

[data-bs-theme="dark"] .ios-input-addon {
    background: var(--bb-bg-tertiary, #2C2C2E);
    color: var(--bb-text-secondary, #8E8E93);
}

.ios-readonly-field {
    padding: 10px 14px;
    min-height: 44px;
    display: flex;
    align-items: center;
    background: var(--bb-bg-secondary, #F2F2F7);
    border-radius: 10px;
}

[data-bs-theme="dark"] .ios-readonly-field {
    background: var(--bb-bg-tertiary, #2C2C2E);
}

.ios-readonly-value {
    font-size: 16px;
    font-weight: 500;
    color: var(--bb-text-primary, #000000);
}

[data-bs-theme="dark"] .ios-readonly-value {
    color: var(--bb-text-primary, #ffffff);
}

/* ============ IOS BOTTOM SHEET ============ */
.ios-bottom-sheet {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1050;
    visibility: hidden;
    pointer-events: none;
}

.ios-bottom-sheet.show {
    visibility: visible;
    pointer-events: auto;
}

.ios-bottom-sheet-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
}

.ios-bottom-sheet.show .ios-bottom-sheet-backdrop {
    background: rgba(0, 0, 0, 0.4);
}

.ios-bottom-sheet-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bb-bg-primary, #ffffff);
    border-radius: 20px 20px 0 0;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    padding-bottom: env(safe-area-inset-bottom);
}

.ios-bottom-sheet.show .ios-bottom-sheet-content {
    transform: translateY(0);
}

[data-bs-theme="dark"] .ios-bottom-sheet-content {
    background: var(--bb-bg-secondary, #1C1C1E);
}

.ios-bottom-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--bb-border-color, rgba(0, 0, 0, 0.1));
    flex-shrink: 0;
}

[data-bs-theme="dark"] .ios-bottom-sheet-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.ios-sheet-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--bb-bg-secondary, #E5E5EA);
    border: none;
    color: var(--bb-text-secondary, #8E8E93);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.ios-sheet-close:active {
    opacity: 0.7;
}

[data-bs-theme="dark"] .ios-sheet-close {
    background: var(--bb-bg-tertiary, #3A3A3C);
}

.ios-sheet-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--bb-text-primary, #000000);
    margin: 0;
}

[data-bs-theme="dark"] .ios-sheet-title {
    color: var(--bb-text-primary, #ffffff);
}

.ios-sheet-spacer {
    width: 30px;
}

.ios-bottom-sheet-search {
    padding: 12px 16px;
    background: var(--bb-bg-secondary, #F2F2F7);
    flex-shrink: 0;
}

[data-bs-theme="dark"] .ios-bottom-sheet-search {
    background: var(--bb-bg-primary, #000000);
}

.ios-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bb-bg-primary, #ffffff);
    border-radius: 10px;
    padding: 10px 12px;
}

[data-bs-theme="dark"] .ios-search-box {
    background: var(--bb-bg-tertiary, #2C2C2E);
}

.ios-search-box i {
    color: var(--bb-text-tertiary, #8E8E93);
    font-size: 16px;
    flex-shrink: 0;
}

.ios-search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 16px;
    color: var(--bb-text-primary, #000000);
    padding: 0;
    min-width: 0;
}

.ios-search-input:focus {
    outline: none;
}

.ios-search-input::placeholder {
    color: var(--bb-text-tertiary, #8E8E93);
}

[data-bs-theme="dark"] .ios-search-input {
    color: var(--bb-text-primary, #ffffff);
}

.ios-search-clear {
    background: transparent;
    border: none;
    color: var(--bb-text-tertiary, #8E8E93);
    font-size: 18px;
    padding: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.ios-bottom-sheet-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

.ios-list-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 14px 20px;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--bb-border-color, rgba(0, 0, 0, 0.05));
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease;
}

.ios-list-item:active {
    background: var(--bb-bg-secondary, #F2F2F7);
}

[data-bs-theme="dark"] .ios-list-item {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .ios-list-item:active {
    background: var(--bb-bg-tertiary, #2C2C2E);
}

.ios-list-item-content {
    flex: 1;
    min-width: 0;
}

.ios-list-item-title {
    font-size: 17px;
    font-weight: 500;
    color: var(--bb-text-primary, #000000);
    margin-bottom: 2px;
}

[data-bs-theme="dark"] .ios-list-item-title {
    color: var(--bb-text-primary, #ffffff);
}

.ios-list-item-subtitle {
    font-size: 15px;
    color: var(--bb-text-secondary, #8E8E93);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ios-list-item-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: var(--bb-text-secondary, #8E8E93);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 4px;
    padding: 2px 6px;
    background: var(--bb-bg-secondary, #F2F2F7);
    border-radius: 4px;
}

[data-bs-theme="dark"] .ios-list-item-badge {
    background: var(--bb-bg-tertiary, #3A3A3C);
}

.ios-list-item-arrow {
    color: var(--bb-text-tertiary, #C7C7CC);
    font-size: 18px;
    flex-shrink: 0;
    margin-left: 12px;
}

[data-bs-theme="dark"] .ios-list-item-arrow {
    color: var(--bb-text-tertiary, #48484A);
}

.ios-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--bb-text-tertiary, #C7C7CC);
}

.ios-empty-state i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.ios-empty-state p {
    font-size: 17px;
    margin: 0;
    color: var(--bb-text-secondary, #8E8E93);
}

/* ============ IOS SELECT BUTTON (Desktop) ============ */
.ios-select-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    padding: 12px 16px;
    background: var(--bb-bg-secondary, #F2F2F7);
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s ease;
    text-align: left;
}

.ios-select-button:hover {
    background: var(--bb-bg-tertiary, #E5E5EA);
}

.ios-select-button:active {
    transform: scale(0.99);
}

.ios-select-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

[data-bs-theme="dark"] .ios-select-button {
    background: var(--bb-bg-tertiary, #2C2C2E);
}

[data-bs-theme="dark"] .ios-select-button:hover {
    background: var(--bb-bg-quaternary, #3A3A3C);
}

.ios-select-content {
    flex: 1;
    min-width: 0;
}

.ios-select-value {
    font-size: 17px;
    font-weight: 500;
    color: var(--bb-text-primary, #000000);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-bs-theme="dark"] .ios-select-value {
    color: var(--bb-text-primary, #ffffff);
}

.ios-select-placeholder {
    font-size: 17px;
    color: var(--bb-text-tertiary, #C7C7CC);
}

[data-bs-theme="dark"] .ios-select-placeholder {
    color: var(--bb-text-tertiary, #48484A);
}

.ios-select-arrow {
    color: var(--bb-text-tertiary, #C7C7CC);
    font-size: 18px;
    flex-shrink: 0;
    margin-left: 8px;
}

[data-bs-theme="dark"] .ios-select-arrow {
    color: var(--bb-text-tertiary, #48484A);
}

/* ============ PWA COMPACT CALENDAR MODE ============ */
/* Optimized for iPhone PWA to fit calendar + time slots on one screen without scrolling */
/* Target: devices under ~950px viewport height (typical iPhone in PWA mode) */

@media (max-height: 950px) {
    /* Compact month header */
    .ios-cal-month-header {
        padding: 8px 16px 4px;
    }
    
    .ios-cal-year {
        font-size: 11px;
        letter-spacing: 0.3px;
    }
    
    .ios-cal-month-name {
        font-size: 24px;
        line-height: 1;
    }
    
    .ios-cal-nav-btn {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
    
    /* Compact weekday headers */
    .ios-cal-weekdays {
        padding: 4px 4px 2px;
    }
    
    .ios-cal-weekday {
        font-size: 10px;
        padding: 2px 0;
    }
    
    /* Compact calendar days grid */
    .ios-cal-days {
        padding: 0 4px 6px;
    }
    
    .ios-cal-day {
        font-size: 14px;
        padding: 1px;
    }
    
    .ios-cal-day-circle {
        width: 28px;
        height: 28px;
    }
    
    .ios-cal-day-dots {
        bottom: 0px;
    }
    
    .ios-cal-day-dot {
        width: 3px;
        height: 3px;
    }
    
    /* Compact divider */
    .ios-divider {
        height: 4px;
    }
    
    /* Compact selected date header */
    .ios-selected-date-header {
        padding: 8px 16px 6px;
    }
    
    .ios-selected-date-title {
        font-size: 10px;
        margin-bottom: 1px;
    }
    
    .ios-selected-date-display {
        font-size: 15px;
    }
    
    /* Compact time period headers */
    .ios-time-period {
        margin-bottom: 2px;
    }
    
    .ios-time-period-header {
        font-size: 10px;
        padding: 4px 16px 2px;
        letter-spacing: 0.5px;
    }
    
    /* Compact time slots */
    .ios-time-list {
        margin: 0 10px 4px;
        border-radius: 8px;
    }
    
    .ios-time-item {
        padding: 8px 12px;
        min-height: 38px;
    }
    
    .ios-time-radio {
        width: 18px;
        height: 18px;
        margin-right: 10px;
    }
    
    .ios-time-item.selected .ios-time-radio::after {
        width: 5px;
        height: 5px;
    }
    
    .ios-time-value {
        font-size: 15px;
    }
    
    .ios-time-status {
        font-size: 12px;
        padding-left: 8px;
    }
    
    .ios-time-status i {
        font-size: 14px;
    }
    
    /* Taller time scroll area to show more slots */
    .ios-time-list-scroll {
        max-height: 160px;
    }
    
    /* Compact continue bar */
    .ios-continue-bar {
        padding: 8px 12px;
        padding-bottom: max(8px, calc(8px + env(safe-area-inset-bottom)));
    }
    
    .ios-continue-button {
        min-height: 44px;
        font-size: 15px;
        border-radius: 10px;
    }
    
    /* Compact today button */
    .ios-today-button {
        width: 48px;
        height: 48px;
        bottom: max(70px, calc(70px + env(safe-area-inset-bottom)));
        right: 16px;
    }
    
    .ios-today-month {
        font-size: 7px;
    }
    
    .ios-today-day {
        font-size: 16px;
    }
    
    /* Compact no times card */
    .ios-no-times-card {
        margin: 12px;
        padding: 16px;
    }
    
    .ios-no-times-icon {
        font-size: 40px;
        margin-bottom: 8px;
    }
    
    .ios-no-times-title {
        font-size: 17px;
        margin-bottom: 4px;
    }
    
    .ios-no-times-message {
        font-size: 13px;
    }
    
    /* Compact loading state */
    .ios-time-loading {
        padding: 24px 16px;
        margin: 12px;
    }
    
    .ios-time-loading-spinner {
        width: 24px;
        height: 24px;
        margin-bottom: 8px;
    }
    
    .ios-time-loading-text {
        font-size: 13px;
    }
}

/* Extra compact for very small screens (iPhone SE, mini) */
@media (max-height: 750px) {
    .ios-cal-month-name {
        font-size: 20px;
    }
    
    .ios-cal-day-circle {
        width: 24px;
        height: 24px;
    }
    
    .ios-cal-day {
        font-size: 13px;
    }
    
    .ios-time-list-scroll {
        max-height: 120px;
    }
    
    .ios-time-item {
        padding: 6px 10px;
        min-height: 34px;
    }
    
    .ios-time-value {
        font-size: 14px;
    }
}



