/* iOS Cupertino Style Theme for UCAR on .NET 10 (FluentUI Blazor v5 components + hand-rolled patterns) */
:root {
    --ios-bg: #f2f2f7;
    --ios-card: rgba(255, 255, 255, 0.85);
    --ios-border: rgba(0, 0, 0, 0.08);
}

body.ios-background {
    background-color: var(--ios-bg);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    /* Khóa rubber-band/trượt nền kiểu native (iPhone X vuốt lên/xuống):
       tới biên thì dừng cứng, không nảy trang, không pull-to-refresh.
       Giữ body scroll bình thường để không vỡ các trang dài (Home/Admin);
       vùng cuộn nội bộ (sheet, main) cuộn độc lập như view native. */
    overscroll-behavior: none;
    overscroll-behavior-y: none;
}

@supports (-webkit-touch-callout: none) {
    /* iOS Safari: cuộn mượt trong vùng nội bộ + chặn bounce lan ra body */
    .app-main,
    .cupertino-sheet,
    .osm-wrapper {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
}

.ios-glass {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.ios-screen-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.map-viewport {
    position: absolute;
    inset: 0;
}

.cupertino-sheet {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    border-radius: 28px 28px 0 0;
    padding: 16px 20px 32px;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.12);
    max-height: 85vh;
    overflow-y: auto;
}

.sheet-grabber {
    width: 44px;
    height: 5px;
    background-color: rgba(0, 0, 0, 0.25);
    border-radius: 99px;
    margin: 0 auto 14px;
}

.ios-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.05);
    padding: 12px 16px;
    border-radius: 16px;
}

.ios-input {
    background: transparent;
    border: none;
    outline: none;
    width: 100%;
    font-size: 14px;
    font-weight: 500;
}

.dot-pin {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-pickup { background-color: #10b981; }
.dot-dropoff { background-color: #f43f5e; }

.vehicle-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vehicle-card {
    background: #ffffff;
    border: 2px solid transparent;
    padding: 12px 16px;
    border-radius: 18px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: all 0.2s ease;
}

.vehicle-card.selected {
    border-color: #007AFF;
    background: rgba(0, 122, 255, 0.05);
}

/* Hide Leaflet Attribution Watermark */
.leaflet-control-attribution {
    display: none !important;
}

/* Chấm xanh vị trí hiện tại: CSS global vì Leaflet inject DOM lúc runtime
   (không mang scope attribute của CSS isolation). */
.osm-myloc-dot {
    position: relative;
}

.osm-myloc-dot::after {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid rgba(0, 122, 255, 0.45);
    animation: osm-myloc-ping 2s ease-out infinite;
}

@keyframes osm-myloc-ping {
    0% { transform: scale(0.6); opacity: 1; }
    100% { transform: scale(1.25); opacity: 0; }
}

.ios-modal-backdrop {
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(10px);
}

.audio-waves .bar {
    width: 4px;
    height: 20px;
    background-color: #10b981;
    border-radius: 4px;
    animation: wave 1s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% { height: 6px; }
    50% { height: 28px; }
}

/* Shell card xác thực dùng chung (Login/Signup/ForgotPassword):
   CSS isolation không xuyên component nên không để ở Login.razor.css. */
.auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    max-width: 420px;
    width: 100%;
    border-radius: 28px;
    padding: 36px 28px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-brand {
    text-align: center;
    margin-bottom: 8px;
}

.auth-logo {
    width: 72px;
    height: 72px;
    margin: 0 auto 12px;
    border-radius: 22px;
    background: #007AFF;
    color: #fff;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0, 122, 255, 0.35);
}

.auth-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.auth-subtitle {
    color: #8e8e93;
    font-size: 0.9rem;
    margin-bottom: 0;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #8e8e93;
    font-size: 0.82rem;
    margin: 2px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
}

.auth-otp {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-otp-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #3a3a3c;
    margin: 0;
}

.auth-otp-code input {
    letter-spacing: 6px;
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.auth-links {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.86rem;
}

.auth-links a {
    color: #007AFF;
    font-weight: 600;
    text-decoration: none;
}

.auth-error {
    color: #ff3b30;
    font-size: 0.85rem;
    text-align: center;
}

@media (prefers-color-scheme: dark) {
    .auth-divider::before,
    .auth-divider::after {
        background: rgba(255, 255, 255, 0.15);
    }

    .auth-otp-label {
        color: #c7c7cc;
    }

    .auth-links a {
        color: #0A84FF;
    }
}

/* Slot cho PWA install prompt (MainLayout + GateLayout) */
.pwa-slot {
    display: flex;
    justify-content: flex-end;
    padding: 8px 12px 0;
}

@media (max-width: 767.98px) {
    .pwa-slot {
        justify-content: center;
        padding: 12px 16px 0;
    }
}

/* Auth responsive: mobile full-bleed gọn + input 16px chống Safari auto-zoom;
   tablet cột thoáng 480px; màn lớn giữ 420px. */
@media (max-width: 480px) {
    .auth-screen {
        padding: 16px 16px calc(20px + env(safe-area-inset-bottom, 0px));
        min-height: 100dvh;
    }

    .auth-card {
        padding: 28px 20px;
        border-radius: 24px;
    }

    .auth-otp input {
        font-size: 16px;
    }
}

@media (min-width: 481px) and (max-width: 1024px) {
    .auth-card {
        max-width: 480px;
        padding: 40px 36px;
    }
}
