/* Airbnb Design System — Shared Tokens, Navigation, Controls & Bottom Sheet */

:root {
    /* Background & Surface Palette */
    --bg-primary: #ffffff;
    --surface-warm: #f7f7f7;
    --surface-neutral: #f2f2f2;

    /* Text & Ink Hierarchy */
    --text-primary: #222222;
    --text-secondary: #6a6a6a;
    --text-disabled: #c1c1c1;
    --text-inverse: #ffffff;

    /* Brand & Accent Colors */
    --brand-rausch: #ff385c;
    --brand-rausch-active: #e00b41;
    --brand-rausch-disabled: #ffd1da;

    /* Semantic Status Colors */
    --semantic-error: #c13515;
    --semantic-error-bg: #fff8f6;
    --semantic-success: #008a05;
    --semantic-success-bg: #f3fbf4;
    --semantic-warning: #e07912;

    /* Border & Divider Tokens */
    --border-subtle: #dddddd;
    --border-medium: #c1c1c1;
    --border-strong: #222222;

    /* Elevation & Radii */
    --shadow-card: rgba(0, 0, 0, 0.02) 0px 0px 0px 1px, rgba(0, 0, 0, 0.04) 0px 2px 6px 0px, rgba(0, 0, 0, 0.1) 0px 4px 8px 0px;
    --shadow-modal: 0 8px 28px rgba(0, 0, 0, 0.28);
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-2xl: 32px;
    --radius-pill: 9999px;

    /* Typography */
    --font-sans: 'Airbnb Cereal VF', Circular, 'Inter', -apple-system, system-ui, Roboto, 'Helvetica Neue', sans-serif;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background: var(--bg-primary);
    color: var(--text-primary);
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.43;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

:focus-visible {
    outline: 2px solid var(--text-primary);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

:focus:not(:focus-visible) {
    outline: none;
}

/* ─── Top Navigation Bar (80px Sticky Airbnb Header) ─── */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 80px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-subtle);
}

.top-nav-inner {
    max-width: 1440px;
    height: 100%;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    flex-shrink: 0;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--brand-rausch);
    color: var(--text-inverse);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.brand-name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--brand-rausch);
}

.top-nav-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
}

.top-nav-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 100%;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s ease;
}

.top-nav-tab:hover {
    color: var(--text-primary);
}

.top-nav-tab.active {
    color: var(--text-primary);
}

.top-nav-tab.active::after {
    content: '';
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 0;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
}

.top-nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.logout-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, background 0.15s ease;
}

.logout-pill:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
    border-color: var(--border-medium);
}

/* ─── Page Container ─── */
.page-shell {
    max-width: 1440px;
    margin: 0 auto;
    padding: 32px 40px 64px;
}

/* ─── Button Variants (Airbnb Component Specs) ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.25;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease, opacity 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.btn:active:not(:disabled) {
    transform: scale(0.98);
}

.btn:disabled {
    cursor: not-allowed;
}

/* Primary CTA Button (Rausch) */
.btn-primary {
    background: var(--brand-rausch);
    color: var(--text-inverse);
    border: none;
}

.btn-primary:hover:not(:disabled) {
    background: var(--brand-rausch-active);
}

.btn-primary:disabled {
    background: var(--brand-rausch-disabled);
    color: var(--text-inverse);
}

/* Secondary Solid Button (Near-Black Ink) */
.btn-secondary {
    background: var(--text-primary);
    color: var(--text-inverse);
    border: none;
}

.btn-secondary:hover:not(:disabled) {
    background: #000000;
}

.btn-secondary:disabled {
    background: var(--surface-neutral);
    color: var(--text-disabled);
}

/* Tertiary / Outline Button */
.btn-tertiary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--text-primary);
}

.btn-tertiary:hover:not(:disabled) {
    background: var(--surface-warm);
}

.btn-tertiary:disabled {
    border-color: var(--border-subtle);
    color: var(--text-disabled);
}

/* Subtle Outline Button (Light Gray Border) */
.btn-outline-subtle {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    font-size: 14px;
    padding: 10px 16px;
}

.btn-outline-subtle:hover:not(:disabled) {
    border-color: var(--text-primary);
    background: var(--surface-warm);
}

/* Circular Search Action Button (48×48 Rausch Orb) */
.icon-btn-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--brand-rausch);
    color: var(--text-inverse);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, transform 0.1s ease;
}

.icon-btn-circle:hover {
    background: var(--brand-rausch-active);
}

.icon-btn-circle:active {
    transform: scale(0.96);
}

/* Small Circular Outline Icon Button (32×32) */
.icon-btn-outline {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.icon-btn-outline:hover {
    transform: scale(1.04);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* ─── Text Input (Airbnb Form Control) ─── */
.text-input {
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 16px;
    line-height: 1.25;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.text-input::placeholder {
    color: var(--text-secondary);
}

.text-input:focus {
    outline: none;
    border-color: var(--text-primary);
    box-shadow: inset 0 0 0 1px var(--text-primary);
}

/* ─── Toast Notification ─── */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    padding: 14px 24px;
    border-radius: var(--radius-md);
    background: var(--text-primary);
    color: var(--text-inverse);
    font-weight: 600;
    font-size: 14px;
    box-shadow: var(--shadow-modal);
    z-index: 1000;
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1), opacity 0.3s ease;
    pointer-events: none;
    max-width: 90vw;
    text-align: center;
}

.toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-success {
    background: var(--semantic-success);
}

.toast-error {
    background: var(--semantic-error);
}

.toast-info {
    background: var(--text-primary);
}

/* ─── Select Pill (mobile-only trigger, hidden on desktop) ─── */
.select-pill {
    display: none;
}

/* ─── Bottom Sheet (Mobile Selection Drawer) ─── */
.sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.sheet-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: var(--shadow-modal);
    z-index: 201;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    padding-bottom: env(safe-area-inset-bottom, 12px);
}

.bottom-sheet.open {
    transform: translateY(0);
}

.sheet-handle {
    width: 36px;
    height: 4px;
    background: var(--border-subtle);
    border-radius: 2px;
    margin: 10px auto 0;
    touch-action: none;
}

.sheet-title {
    padding: 16px 24px 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sheet-options {
    padding: 0 20px;
}

.sheet-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
    min-height: 54px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 16px;
    color: var(--text-primary);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.sheet-option:last-child {
    border-bottom: none;
}

.sheet-option.selected {
    color: var(--text-primary);
    font-weight: 600;
}

.sheet-option .check {
    color: var(--brand-rausch);
    display: inline-flex;
    align-items: center;
}

.sheet-cancel-btn {
    display: block;
    width: calc(100% - 40px);
    margin: 12px 20px 16px;
    padding: 14px;
    background: var(--surface-warm);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* ─── Responsive Breakpoints (design.md: 744px tablet, 1128px desktop) ─── */
@media (max-width: 1128px) {
    .top-nav-inner {
        padding: 0 24px;
    }

    .page-shell {
        padding: 24px 24px 56px;
    }
}

@media (max-width: 744px) {
    .top-nav {
        height: 68px;
    }

    .top-nav-inner {
        padding: 0 16px;
        gap: 8px;
    }

    .brand-name {
        font-size: 15px;
    }

    .top-nav-tab {
        padding: 0 10px;
        font-size: 13px;
    }

    .top-nav-tab.active::after {
        left: 10px;
        right: 10px;
    }

    .logout-pill {
        height: 36px;
        padding: 0 12px;
        font-size: 13px;
    }

    .logout-pill .logout-text {
        display: none;
    }

    .page-shell {
        padding: 20px 16px 100px;
    }

    .select-pill {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
        width: 100%;
        min-height: 44px;
        padding: 10px 14px;
        background: var(--bg-primary);
        border: 1px solid var(--border-medium);
        border-radius: var(--radius-pill);
        font-family: inherit;
        font-size: 14px;
        font-weight: 600;
        color: var(--text-primary);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .pill-chevron {
        color: var(--text-secondary);
        font-size: 12px;
    }
}
