/* 
 * Urban Company Replica Styles 
 * Mobile: Bottom Sheet | Desktop: Centered Card
 */

/* Overlay */
.uc-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999999;
    display: none;
    /* Flex when active */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.uc-modal-overlay.show {
    opacity: 1;
}

/* Modal Content Card */
.uc-modal-card {
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.1, 0.7, 0.1, 1);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* DESKTOP STYLES (Default) */
@media (min-width: 768px) {
    .uc-modal-overlay {
        align-items: center;
        justify-content: center;
    }

    .uc-modal-card {
        width: 480px;
        /* Slightly wider for better breathing room */
        max-height: 85vh;
        border-radius: 20px;
        /* Softer corners */
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
        /* Premium diffuse shadow */
        transform: scale(0.95);
    }

    .uc-modal-overlay.show .uc-modal-card {
        transform: scale(1);
    }
}

/* MOBILE STYLES (Bottom Sheet) */
@media (max-width: 767px) {
    .uc-modal-overlay {
        align-items: flex-end;
        /* Align to bottom */
    }

    .uc-modal-card {
        width: 100%;
        max-height: 90vh;
        /* Taller on mobile */
        border-top-left-radius: 24px;
        border-top-right-radius: 24px;
        transform: translateY(100%);
        /* Start off-screen */
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
    }

    .uc-modal-overlay.show .uc-modal-card {
        transform: translateY(0);
    }

    /* Pull indicator for mobile */
    .uc-modal-card::before {
        content: '';
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 48px;
        height: 5px;
        background: #e5e5e5;
        border-radius: 4px;
    }
}

/* Header */
.uc-header {
    padding: 24px 24px 16px;
    /* Optimized padding */
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    flex-shrink: 0;
}

.uc-title {
    font-size: 20px;
    /* Larger title */
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.2;
}

.uc-step-indicator {
    font-size: 13px;
    color: #666;
    font-weight: 500;
    margin-top: 2px;
}

.uc-close-btn {
    background: #f2f2f2;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
}

.uc-close-btn:hover {
    background: #e0e0e0;
}

/* Scrollable Body */
.uc-body {
    padding: 0 24px 24px;
    overflow-y: auto;
    flex: 1;
}

/* Section Titles */
.uc-section-title {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 24px 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Date Strip (Horizontal Scroll) */
.uc-date-strip {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    /* Room for scrollbar if visible/touch */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE */
    mask-image: linear-gradient(to right, black 90%, transparent 100%);
    /* Fade out effect */
    -webkit-mask-image: linear-gradient(to right, black 90%, transparent 100%);
}

.uc-date-strip::-webkit-scrollbar {
    display: none;
}

.uc-date-pill {
    min-width: 64px;
    height: 76px;
    border-radius: 16px;
    /* Smooth corners */
    background: #f5f5f7;
    /* iOS gray */
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    user-select: none;
}

.uc-date-pill:active {
    transform: scale(0.95);
}

.uc-date-pill.selected {
    background: #000;
    /* UC Black */
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.uc-day-name {
    font-size: 12px;
    margin-bottom: 4px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.uc-date-num {
    font-size: 20px;
    font-weight: 700;
}

/* Time Grid */
.uc-time-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.uc-time-slot {
    padding: 12px;
    /* Taller touch target */
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    background: #fff;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.uc-time-slot:hover {
    background: #f9f9f9;
    border-color: #ccc;
}

.uc-time-slot:active {
    transform: scale(0.98);
}

.uc-time-slot.selected {
    border-color: #000;
    background: #fff;
    box-shadow: inset 0 0 0 1.5px #000;
    /* Thicker active border */
    font-weight: 600;
}

/* Summary / Cart Section */
.uc-summary {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 24px;
    border: 1px solid #f0f0f0;
}

.uc-summary-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #444;
    margin-bottom: 8px;
}

.uc-summary-total {
    border-top: 1px solid #e5e5e5;
    margin-top: 12px;
    padding-top: 12px;
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 16px;
    color: #000;
}

/* Address Input */
.uc-input-group {
    margin-bottom: 20px;
}

.uc-input {
    width: 100%;
    padding: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
    background: #f9f9f9;
}

.uc-input:focus {
    border-color: #000;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
    /* Soft focus ring */
}

.uc-input::placeholder {
    color: #8e8e93;
}

.uc-location-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    background: #f0f8ff;
    /* Light Blue tint */
    color: #007aff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    margin-bottom: 10px;
}

/* Footer Action */
.uc-footer {
    padding: 16px 24px 24px;
    background: #fff;
    border-top: 1px solid #f5f5f5;
    flex-shrink: 0;
}

.uc-action-btn {
    width: 100%;
    background: #000;
    color: #fff;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.uc-action-btn:active {
    transform: scale(0.98);
}

.uc-action-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Helpers */
.uc-hidden {
    display: none !important;
}

/* Animations */
@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes checkIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================================================
   DARK MODE STYLES
   ============================================================ */
body.dark-mode .uc-modal-card {
    background: #1c1c1e;
}

body.dark-mode .uc-header {
    background: #1c1c1e;
}

body.dark-mode .uc-title {
    color: #ffffff;
}

body.dark-mode .uc-step-indicator {
    color: #98989f;
}

body.dark-mode .uc-close-btn {
    background: #2c2c2e;
    color: #ffffff;
}

body.dark-mode .uc-close-btn:hover {
    background: #3a3a3c;
}

body.dark-mode .uc-section-title {
    color: #ffffff;
}

body.dark-mode .uc-date-pill {
    background: #2c2c2e;
    color: #ffffff;
}

body.dark-mode .uc-date-pill.selected {
    background: #ffffff;
    color: #000000;
}

body.dark-mode .uc-time-slot {
    background: #1c1c1e;
    border-color: #38383a;
    color: #ffffff;
}

body.dark-mode .uc-time-slot:hover {
    background: #2c2c2e;
    border-color: #48484a;
}

body.dark-mode .uc-time-slot.selected {
    border-color: #ffffff;
    box-shadow: inset 0 0 0 1.5px #ffffff;
}

body.dark-mode .uc-summary {
    background: #2c2c2e;
    border-color: #38383a;
}

body.dark-mode .uc-summary-item {
    color: #98989f;
}

body.dark-mode .uc-summary-total {
    border-top-color: #38383a;
    color: #ffffff;
}

body.dark-mode .uc-input {
    background: #2c2c2e;
    border-color: #38383a;
    color: #ffffff;
}

body.dark-mode .uc-input:focus {
    border-color: #ffffff;
    background: #1c1c1e;
}

body.dark-mode .uc-input::placeholder {
    color: #636366;
}

body.dark-mode .uc-location-btn {
    background: #1a2a3a;
    color: #0a84ff;
}

body.dark-mode .uc-footer {
    background: #1c1c1e;
    border-top-color: #38383a;
}

body.dark-mode .uc-action-btn {
    background: #ffffff;
    color: #000000;
}

body.dark-mode .uc-action-btn:disabled {
    background: #48484a;
    color: #8e8e93;
}

/* Mobile bottom sheet pull indicator */
@media (max-width: 767px) {
    body.dark-mode .uc-modal-card::before {
        background: #48484a;
    }
}