/* Bay Brothers OS - iOS-Optimized Form Styles */
/* Native iOS feeling for job create and other forms */

/* ============ iOS HEADER ============ */
.ios-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: var(--bb-bg-primary, #ffffff);
    border-bottom: 1px solid var(--bb-border-color, rgba(0, 0, 0, 0.1));
    padding: 0;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

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

.ios-header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 16px 12px;
    /* In browser mode, add safe area padding since there's no parent handling it */
    padding-top: max(8px, env(safe-area-inset-top));
}

/* PWA Mode: Don't add safe area padding here - the parent .page already handles it
   This prevents double safe-area padding on iOS PWA */
.is-pwa .ios-header-content {
    padding-top: 8px;
}

.ios-back-btn {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--bb-primary, #007AFF);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px;
    cursor: pointer;
    transition: opacity 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

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

.ios-back-btn i {
    font-size: 1.25rem;
    font-weight: 600;
}

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

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

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

.ios-header-subtitle {
    font-size: 0.75rem;
    color: var(--bb-text-secondary, #8E8E93);
    margin-top: 2px;
}

.ios-header-spacer {
    height: 44px;
}

/* ============ iOS INPUT FIELDS ============ */
.ios-input,
.form-control.ios-input,
.form-select.ios-input {
    min-height: 52px !important;
    font-size: 17px !important;
    border-radius: 12px !important;
    border: 1px solid var(--bb-border-color, rgba(0, 0, 0, 0.1)) !important;
    background-color: var(--bb-bg-secondary, #F2F2F7) !important;
    padding: 14px 16px !important;
    transition: all 0.2s ease !important;
    -webkit-appearance: none;
    appearance: none;
}

[data-bs-theme="dark"] .ios-input,
[data-bs-theme="dark"] .form-control.ios-input,
[data-bs-theme="dark"] .form-select.ios-input {
    background-color: var(--bb-bg-secondary, #1C1C1E) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: var(--bb-text-primary, #ffffff) !important;
}

.ios-input:focus,
.form-control.ios-input:focus,
.form-select.ios-input:focus {
    border-color: var(--bb-primary, #007AFF) !important;
    background-color: var(--bb-bg-primary, #ffffff) !important;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1) !important;
}

[data-bs-theme="dark"] .ios-input:focus,
[data-bs-theme="dark"] .form-control.ios-input:focus,
[data-bs-theme="dark"] .form-select.ios-input:focus {
    background-color: var(--bb-bg-secondary, #1C1C1E) !important;
    box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.2) !important;
}

/* Date and time inputs on iOS */
input[type="date"].ios-input,
input[type="time"].ios-input {
    padding-right: 16px !important;
}

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

.ios-select-button:active {
    background-color: var(--bb-bg-tertiary, #E5E5EA);
    transform: scale(0.98);
}

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

[data-bs-theme="dark"] .ios-select-button {
    background-color: var(--bb-bg-secondary, #1C1C1E);
    border-color: rgba(255, 255, 255, 0.1);
}

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

.ios-select-content {
    flex: 1;
}

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

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

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

.ios-select-arrow {
    font-size: 1.25rem;
    color: var(--bb-text-secondary, #8E8E93);
    margin-left: 8px;
}

/* ============ iOS BOTTOM SHEET ============ */
.ios-bottom-sheet {
    position: fixed;
    inset: 0;
    z-index: 1050;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ios-bottom-sheet.show {
    pointer-events: all;
    opacity: 1;
}

.ios-bottom-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.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: 70vh;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

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

[data-bs-theme="dark"] .ios-bottom-sheet-content {
    background: var(--bb-bg-primary, #000000);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

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

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

.ios-sheet-close {
    position: absolute;
    left: 16px;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--bb-primary, #007AFF);
    padding: 8px;
    cursor: pointer;
    transition: opacity 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

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

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

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

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

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

/* ============ iOS SEARCH BOX ============ */
.ios-bottom-sheet-search {
    padding: 12px 16px;
    border-bottom: 1px solid var(--bb-border-color, rgba(0, 0, 0, 0.1));
    flex-shrink: 0;
    background: var(--bb-bg-secondary, #F2F2F7);
}

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

.ios-search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bb-bg-primary, #ffffff);
    border-radius: 10px;
    padding: 0 12px;
    border: 1px solid var(--bb-border-color, rgba(0, 0, 0, 0.1));
}

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

.ios-search-box i {
    color: var(--bb-text-secondary, #8E8E93);
    font-size: 1.125rem;
}

.ios-search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 8px;
    font-size: 17px;
    outline: none;
    color: var(--bb-text-primary, #000000);
}

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

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

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

.ios-search-clear:active {
    opacity: 0.5;
}

/* ============ iOS LIST ITEMS ============ */
.ios-bottom-sheet-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

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

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

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

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

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

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

[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);
    margin-bottom: 2px;
}

.ios-list-item-badge {
    display: inline-block;
    font-size: 13px;
    color: var(--bb-primary, #007AFF);
    font-weight: 500;
}

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

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

/* ============ iOS EMPTY STATE ============ */
.ios-empty-state {
    padding: 60px 20px;
    text-align: center;
    color: var(--bb-text-secondary, #8E8E93);
}

.ios-empty-state i {
    font-size: 4rem;
    opacity: 0.3;
    display: block;
    margin-bottom: 16px;
}

.ios-empty-state p {
    font-size: 17px;
    margin: 0;
}

/* ============ iOS BUTTONS ============ */
.ios-button {
    width: 100%;
    min-height: 50px;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.ios-button-primary {
    background: var(--bb-primary, #007AFF);
    color: #ffffff;
}

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

.ios-button-secondary {
    background: var(--bb-bg-secondary, #F2F2F7);
    color: var(--bb-text-primary, #000000);
}

[data-bs-theme="dark"] .ios-button-secondary {
    background: var(--bb-bg-secondary, #1C1C1E);
    color: var(--bb-text-primary, #ffffff);
}

/* ============ iOS ALERTS ============ */
.ios-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-radius: 12px;
    border: none;
}

.ios-alert-warning {
    background: linear-gradient(135deg, rgba(255, 204, 0, 0.15), rgba(255, 204, 0, 0.08));
    border-left: 4px solid #FFCC00;
}

.ios-alert-info {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.15), rgba(0, 122, 255, 0.08));
    border-left: 4px solid #007AFF;
}

.ios-alert-success {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.15), rgba(52, 199, 89, 0.08));
    border-left: 4px solid #34C759;
}

.ios-alert-danger {
    background: linear-gradient(135deg, rgba(255, 59, 48, 0.15), rgba(255, 59, 48, 0.08));
    border-left: 4px solid #FF3B30;
}

.ios-alert-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.ios-alert-warning .ios-alert-icon {
    color: #FFCC00;
}

.ios-alert-info .ios-alert-icon {
    color: #007AFF;
}

.ios-alert-success .ios-alert-icon {
    color: #34C759;
}

.ios-alert-danger .ios-alert-icon {
    color: #FF3B30;
}

[data-bs-theme="dark"] .ios-alert-warning {
    background: linear-gradient(135deg, rgba(255, 214, 10, 0.2), rgba(255, 214, 10, 0.1));
}

[data-bs-theme="dark"] .ios-alert-info {
    background: linear-gradient(135deg, rgba(10, 132, 255, 0.2), rgba(10, 132, 255, 0.1));
}

[data-bs-theme="dark"] .ios-alert-success {
    background: linear-gradient(135deg, rgba(48, 209, 88, 0.2), rgba(48, 209, 88, 0.1));
}

[data-bs-theme="dark"] .ios-alert-danger {
    background: linear-gradient(135deg, rgba(255, 69, 58, 0.2), rgba(255, 69, 58, 0.1));
}

.ios-alert-content {
    flex: 1;
}

.ios-alert-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--bb-text-primary, #000000);
    line-height: 1.4;
}

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

/* ============ iOS WARNING PILL ============ */
.ios-warning-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 204, 0, 0.15);
    border-radius: 20px;
    font-size: 14px;
    color: #FFCC00;
    font-weight: 500;
}

[data-bs-theme="dark"] .ios-warning-pill {
    background: rgba(255, 214, 10, 0.2);
    color: #FFD60A;
}

.ios-warning-pill i {
    font-size: 16px;
}

/* ============ FORM LABELS ============ */
@media (max-width: 767.98px) {
    .form-label {
        font-size: 15px;
        font-weight: 600;
        color: var(--bb-text-primary, #000000);
        margin-bottom: 8px;
    }
    
    [data-bs-theme="dark"] .form-label {
        color: var(--bb-text-primary, #ffffff);
    }
}

/* ============ CARDS - iOS Style ============ */
@media (max-width: 767.98px) {
    .card {
        border-radius: 16px;
        border: 1px solid var(--bb-border-color, rgba(0, 0, 0, 0.1));
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        overflow: hidden;
    }
    
    [data-bs-theme="dark"] .card {
        border-color: rgba(255, 255, 255, 0.1);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    }
    
    .card-header {
        background: var(--bb-bg-secondary, #F2F2F7);
        border-bottom: 1px solid var(--bb-border-color, rgba(0, 0, 0, 0.1));
        padding: 14px 16px;
    }
    
    [data-bs-theme="dark"] .card-header {
        background: var(--bb-bg-secondary, #1C1C1E);
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }
    
    .card-header.bg-success {
        background: linear-gradient(135deg, #34C759, #30D158) !important;
    }
    
    .card-body {
        padding: 16px;
    }
}

/* ============ BUTTONS - iOS Style ============ */
@media (max-width: 767.98px) {
    .btn-lg {
        min-height: 54px !important;
        font-size: 17px !important;
        font-weight: 600 !important;
        border-radius: 12px !important;
        padding: 14px 20px !important;
    }
    
    .btn-primary,
    .btn-success {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
    
    .btn:active {
        transform: scale(0.98);
    }
}

/* ============ SERVICE TASK CARDS - iOS Style ============ */
@media (max-width: 767.98px) {
    .card .card.border {
        border-radius: 12px !important;
        border: 1px solid var(--bb-border-color, rgba(0, 0, 0, 0.1)) !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
        overflow: hidden;
    }
    
    .card .card-body {
        padding: 14px !important;
    }
    
    .form-control-sm,
    .form-select-sm {
        min-height: 44px !important;
        font-size: 16px !important;
        border-radius: 10px !important;
    }
}

/* ============ TOUCH OPTIMIZATIONS ============ */
@media (max-width: 767.98px) {
    /* Prevent zoom on input focus */
    input[type="text"],
    input[type="number"],
    input[type="date"],
    input[type="time"],
    select,
    textarea {
        font-size: 16px !important;
    }
    
    /* Better tap highlights */
    button,
    .btn,
    a {
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Smooth scrolling */
    * {
        -webkit-overflow-scrolling: touch;
    }
}

/* ============ SAFE AREA SUPPORT ============ */
@supports (padding: max(0px)) {
    /* Note: Additional bottom sheet safe area padding is handled in mobile-core.css
       to account for the mobile bottom nav bar */
    
    .ios-header-content {
        padding-top: max(8px, env(safe-area-inset-top));
    }
}

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

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

/* ============ FOCUS STATES - iOS Blue Ring ============ */
.ios-input:focus,
.ios-select-button:focus {
    outline: none;
    border-color: var(--bb-primary, #007AFF) !important;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.15) !important;
}

[data-bs-theme="dark"] .ios-input:focus,
[data-bs-theme="dark"] .ios-select-button:focus {
    border-color: var(--bb-primary, #0A84FF) !important;
    box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.2) !important;
}

/* ============ LOADING SPINNER - iOS Style ============ */
.ios-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.6s linear infinite;
}

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

/* ============ INPUT GROUP - iOS Style ============ */
@media (max-width: 767.98px) {
    .input-group {
        border-radius: 12px;
        overflow: hidden;
    }
    
    .input-group-text {
        min-height: 52px;
        font-size: 17px;
        background-color: var(--bb-bg-secondary, #F2F2F7);
        border-color: var(--bb-border-color, rgba(0, 0, 0, 0.1));
        color: var(--bb-text-secondary, #8E8E93);
    }
    
    [data-bs-theme="dark"] .input-group-text {
        background-color: var(--bb-bg-secondary, #1C1C1E);
        border-color: rgba(255, 255, 255, 0.1);
    }
}

/* ============ STICKY SUMMARY - iOS Style ============ */
@media (max-width: 991.98px) {
    /* Mobile summary should stick to bottom */
    .card.d-lg-none {
        position: sticky;
        bottom: 0;
        z-index: 1020;
        margin-bottom: 0 !important;
        border-radius: 20px 20px 0 0 !important;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    }
    
    [data-bs-theme="dark"] .card.d-lg-none {
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    }
}

/* ============ SMOOTH ANIMATIONS ============ */
.ios-bottom-sheet,
.ios-alert,
.ios-button,
.ios-list-item {
    will-change: transform, opacity;
}

/* ============ ACCESSIBILITY ============ */
@media (prefers-reduced-motion: reduce) {
    .ios-bottom-sheet-content,
    .ios-button,
    .ios-list-item {
        transition: none;
    }
}

/* ============ LANDSCAPE MODE ============ */
@media (max-width: 767.98px) and (orientation: landscape) {
    .ios-bottom-sheet-content {
        max-height: 85vh;
    }
    
    .ios-header-content {
        padding-top: 8px;
        padding-bottom: 8px;
    }
}

/* ============ iOS SERVICE CARDS ============ */
.ios-service-card {
    background: var(--bb-bg-primary, #ffffff);
    border: 1px solid var(--bb-border-color, rgba(0, 0, 0, 0.1));
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

[data-bs-theme="dark"] .ios-service-card {
    background: var(--bb-bg-secondary, #1C1C1E);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

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

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

.ios-service-card-number {
    font-size: 13px;
    font-weight: 600;
    color: var(--bb-text-secondary, #8E8E93);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

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

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

.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: 12px;
}

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

.ios-readonly-field {
    min-height: 52px;
    background: var(--bb-bg-secondary, #F2F2F7);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
}

.ios-readonly-success {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.15), rgba(52, 199, 89, 0.08));
}

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

[data-bs-theme="dark"] .ios-readonly-success {
    background: linear-gradient(135deg, rgba(48, 209, 88, 0.2), rgba(48, 209, 88, 0.1));
}

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

.ios-readonly-success .ios-readonly-value {
    color: #34C759;
}

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

[data-bs-theme="dark"] .ios-readonly-success .ios-readonly-value {
    color: #30D158;
}

/* ============ iOS ADD SERVICE BUTTON ============ */
.ios-add-service-btn {
    width: 100%;
    min-height: 54px;
    background: transparent;
    border: 2px dashed var(--bb-border-color, rgba(0, 122, 255, 0.3));
    border-radius: 12px;
    color: var(--bb-primary, #007AFF);
    font-size: 17px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    margin-bottom: 16px;
}

.ios-add-service-btn:active {
    background: rgba(0, 122, 255, 0.05);
    border-color: var(--bb-primary, #007AFF);
    transform: scale(0.98);
}

[data-bs-theme="dark"] .ios-add-service-btn {
    border-color: rgba(10, 132, 255, 0.3);
    color: var(--bb-primary, #0A84FF);
}

[data-bs-theme="dark"] .ios-add-service-btn:active {
    background: rgba(10, 132, 255, 0.1);
    border-color: var(--bb-primary, #0A84FF);
}

.ios-add-service-btn i {
    font-size: 1.25rem;
}

/* ============ iOS SUMMARY CARD ============ */
@media (max-width: 991.98px) {
    .card.d-lg-none.mt-3 {
        position: sticky;
        bottom: 0;
        z-index: 1020;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        border-radius: 20px 20px 0 0 !important;
        box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12);
        border-bottom: none;
    }
    
    [data-bs-theme="dark"] .card.d-lg-none.mt-3 {
        box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.5);
    }
    
    .card.d-lg-none .card-header.bg-success {
        background: linear-gradient(135deg, #34C759, #30D158) !important;
        border: none;
        padding: 16px 20px;
    }
    
    .card.d-lg-none .card-body {
        padding: 20px;
        padding-bottom: max(20px, calc(env(safe-area-inset-bottom) + 20px));
    }
}

/* ============ iOS FORM SECTION HEADERS ============ */
.ios-section-divider {
    height: 12px;
    background: var(--bb-bg-secondary, #F2F2F7);
    margin: 0 -16px;
    border-top: 1px solid var(--bb-border-color, rgba(0, 0, 0, 0.1));
    border-bottom: 1px solid var(--bb-border-color, rgba(0, 0, 0, 0.1));
}

[data-bs-theme="dark"] .ios-section-divider {
    background: var(--bb-bg-secondary, #1C1C1E);
    border-top-color: rgba(255, 255, 255, 0.1);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* ============ iOS NUMBER INPUT OPTIMIZATIONS ============ */
@media (max-width: 767.98px) {
    input[type="number"].ios-input {
        text-align: right;
        padding-right: 16px !important;
    }
    
    input[type="number"].ios-input::-webkit-inner-spin-button,
    input[type="number"].ios-input::-webkit-outer-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }
}

/* ============ iOS HAPTIC FEEDBACK SIMULATION ============ */
@media (max-width: 767.98px) {
    .ios-button:active,
    .ios-list-item:active,
    .ios-select-button:active,
    .ios-delete-btn:active {
        /* Simulate haptic with quick scale animation */
        animation: iosHaptic 0.1s ease;
    }
}

@keyframes iosHaptic {
    0% { transform: scale(1); }
    50% { transform: scale(0.97); }
    100% { transform: scale(0.98); }
}

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

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

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

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

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

.ios-summary-change {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--bb-primary, #007AFF);
    font-size: 17px;
    font-weight: 400;
    cursor: pointer;
    padding: 0;
    transition: opacity 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.ios-summary-change:active {
    opacity: 0.6;
}

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

/* ============ MOBILE CALENDAR - iOS STYLE ============ */

/* Step Indicator */
.ios-step-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bb-bg-primary, #ffffff);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

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

.ios-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.ios-step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bb-bg-secondary, #E5E5EA);
    color: var(--bb-text-secondary, #8E8E93);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.ios-step.active .ios-step-number {
    background: var(--bb-primary, #007AFF);
    color: #ffffff;
    transform: scale(1.1);
}

.ios-step.completed .ios-step-number {
    background: #34C759;
    color: #ffffff;
}

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

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

[data-bs-theme="dark"] .ios-step.completed .ios-step-number {
    background: #30D158;
}

.ios-step-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--bb-text-secondary, #8E8E93);
    white-space: nowrap;
}

.ios-step.active .ios-step-label {
    color: var(--bb-primary, #007AFF);
    font-weight: 600;
}

.ios-step.completed .ios-step-label {
    color: #34C759;
}

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

[data-bs-theme="dark"] .ios-step.completed .ios-step-label {
    color: #30D158;
}

.ios-step-line {
    flex: 1;
    height: 2px;
    background: var(--bb-bg-secondary, #E5E5EA);
    margin: 0 8px;
    transition: background 0.3s ease;
}

.ios-step-line.completed {
    background: #34C759;
}

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

[data-bs-theme="dark"] .ios-step-line.completed {
    background: #30D158;
}

/* ============ MOBILE MINI CALENDAR ============ */
.mobile-mini-calendar {
    padding: 16px;
    background: var(--bb-bg-primary, #ffffff);
}

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

.calendar-month-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 8px 0;
}

.calendar-nav-btn {
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--bb-primary, #007AFF);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.calendar-nav-btn:active {
    background: var(--bb-bg-secondary, #F2F2F7);
    transform: scale(0.9);
}

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

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

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

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

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.calendar-weekday {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--bb-text-secondary, #8E8E93);
    padding: 8px 4px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.calendar-day {
    aspect-ratio: 1;
    border: none;
    background: var(--bb-bg-secondary, #F2F2F7);
    border-radius: 10px;
    color: var(--bb-text-primary, #000000);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

.calendar-day:active:not(.disabled) {
    transform: scale(0.9);
}

.calendar-day.other-month {
    opacity: 0.3;
}

.calendar-day.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.calendar-day.today {
    border: 2px solid var(--bb-primary, #007AFF);
    font-weight: 700;
}

.calendar-day.selected {
    background: var(--bb-primary, #007AFF);
    color: #ffffff;
    font-weight: 700;
    transform: scale(1.05);
}

.calendar-day.has-jobs .calendar-day-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--bb-primary, #007AFF);
    position: absolute;
    bottom: 4px;
}

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

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

[data-bs-theme="dark"] .calendar-day.today {
    border-color: var(--bb-primary, #0A84FF);
}

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

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

.calendar-day-number {
    font-size: 15px;
}

/* ============ TIME SLOT SELECTION ============ */
.time-slot-container {
    border-top: 1px solid var(--bb-border-color, rgba(0, 0, 0, 0.1));
    background: var(--bb-bg-secondary, #F2F2F7);
}

[data-bs-theme="dark"] .time-slot-container {
    background: var(--bb-bg-secondary, #1C1C1E);
    border-top-color: rgba(255, 255, 255, 0.1);
}

.time-slot-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--bb-border-color, rgba(0, 0, 0, 0.1));
}

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

.time-slot-header h6 {
    font-size: 15px;
    font-weight: 600;
    color: var(--bb-text-primary, #000000);
    margin: 0;
}

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

.time-slot-date {
    font-size: 13px;
    color: var(--bb-text-secondary, #8E8E93);
    display: block;
    margin-top: 4px;
}

.time-slot-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 16px;
}

.time-slot {
    min-height: 56px;
    background: var(--bb-bg-primary, #ffffff);
    border: 2px solid var(--bb-border-color, rgba(0, 0, 0, 0.1));
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.time-slot:active:not(.unavailable) {
    transform: scale(0.95);
}

.time-slot.selected {
    background: var(--bb-primary, #007AFF);
    border-color: var(--bb-primary, #007AFF);
    transform: scale(1.05);
}

.time-slot.unavailable {
    background: var(--bb-bg-secondary, #F2F2F7);
    border-color: transparent;
    opacity: 0.5;
    cursor: not-allowed;
}

.time-slot.conflict {
    background: rgba(255, 204, 0, 0.1);
    border-color: #FFCC00;
}

[data-bs-theme="dark"] .time-slot {
    background: var(--bb-bg-tertiary, #2C2C2E);
    border-color: rgba(255, 255, 255, 0.1);
}

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

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

[data-bs-theme="dark"] .time-slot.conflict {
    background: rgba(255, 214, 10, 0.15);
    border-color: #FFD60A;
}

.time-slot-time {
    font-size: 15px;
    font-weight: 600;
    color: var(--bb-text-primary, #000000);
}

.time-slot.selected .time-slot-time {
    color: #ffffff;
}

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

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

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

.time-slot-status {
    font-size: 18px;
    position: absolute;
    top: 4px;
    right: 4px;
}

.time-slot.selected .time-slot-status {
    color: #ffffff;
}

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

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

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

/* ============ SCHEDULE SUMMARY CARD ============ */
.ios-summary-card {
    background: var(--bb-bg-secondary, #F2F2F7);
    border-radius: 12px;
    padding: 16px;
    position: relative;
}

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

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

.ios-summary-value {
    font-size: 17px;
    font-weight: 600;
    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: none;
    border: none;
    color: var(--bb-primary, #007AFF);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.ios-summary-change:active {
    background: rgba(0, 122, 255, 0.1);
}

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

[data-bs-theme="dark"] .ios-summary-change:active {
    background: rgba(10, 132, 255, 0.2);
}

/* ============ FINAL SUMMARY ============ */
.ios-final-summary {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

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

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

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

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

/* ============ MOBILE STEP ANIMATIONS ============ */
.mobile-calendar-step {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============ CALENDAR DAY PULSE ANIMATION ============ */
.calendar-day.selected {
    animation: pulseSelect 0.4s ease;
}

@keyframes pulseSelect {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1.05); }
}

/* ============ TIME SLOT AVAILABILITY LEGEND ============ */
.time-slot-legend {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bb-bg-primary, #ffffff);
    border-top: 1px solid var(--bb-border-color, rgba(0, 0, 0, 0.1));
    font-size: 13px;
}

[data-bs-theme="dark"] .time-slot-legend {
    background: var(--bb-bg-secondary, #1C1C1E);
    border-top-color: rgba(255, 255, 255, 0.1);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--bb-text-secondary, #8E8E93);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-dot.available {
    background: #34C759;
}

.legend-dot.conflict {
    background: #FFCC00;
}

.legend-dot.unavailable {
    background: var(--bb-text-tertiary, #C7C7CC);
}

/* ============ RESPONSIVE ADJUSTMENTS ============ */
@media (max-width: 374px) {
    /* iPhone SE and smaller */
    .time-slot-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ios-step-label {
        font-size: 11px;
    }
}

@media (min-width: 375px) and (max-width: 767px) {
    /* iPhone and standard phones */
    .time-slot-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (orientation: landscape) and (max-width: 767px) {
    /* Landscape mobile */
    .time-slot-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .calendar-days {
        gap: 4px;
    }
}

