@import url('./styles/card.css');
@import url('./styles/listing-details.css');
@import url('./styles/select.css');
@import url('./styles/bookings.css');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    /* ==================== COLORS ==================== */

    /* Brand Colors */
    --color-primary: #0066cc;
    --color-primary-light: #3385d6;
    --color-primary-dark: #0052a3;
    --color-secondary: #6c757d;
    --color-secondary-light: #8c959d;
    --color-secondary-dark: #545b62;
    --color-accent: #ff6b6b;

    /* Semantic Colors */
    --color-success: #28a745;
    --color-success-light: #48b461;
    --color-success-dark: #1e7e34;
    --color-warning: #ffc107;
    --color-warning-light: #ffcd38;
    --color-warning-dark: #d39e00;
    --color-error: #dc3545;
    --color-error-light: #e15361;
    --color-error-dark: #bd2130;
    --color-info: #17a2b8;
    --color-info-light: #3ab0c3;
    --color-info-dark: #117a8b;

    /* Neutral/Gray Scale https://tailwindcss.com/docs/colors */
    --color-white: #ffffff;
    --color-gray-50: oklch(98.5% 0 0);
    --color-gray-100: oklch(97% 0 0);
    --color-gray-200: oklch(92.2% 0 0);
    --color-gray-300: oklch(87% 0 0);
    --color-gray-400: oklch(70.8% 0 0);
    --color-gray-500: oklch(55.6% 0 0);
    --color-gray-600: oklch(43.9% 0 0);
    --color-gray-700: oklch(37.1% 0 0);
    --color-gray-800: oklch(26.9% 0 0);
    --color-gray-900: oklch(20.5% 0 0);
    --color-gray-950: oklch(14.5% 0 0);
    --color-black: #000000;

    /* Background Colors */
    --color-bg-primary: #F5F5F9;
    --color-bg-secondary: #f9fafb;
    --color-bg-tertiary: #f3f4f6;
    --color-bg-overlay: rgba(0, 0, 0, 0.5);

    /* Text Colors */
    --color-text-primary: #111827;
    --color-text-secondary: #6b7280;
    --color-text-tertiary: #9ca3af;
    --color-text-inverse: #ffffff;
    --color-text-disabled: #d1d5db;
    --color-text-link: #0066cc;
    --color-text-link-hover: #0052a3;

    /* Border Colors */
    --color-border-primary: #e5e7eb;
    --color-border-secondary: #d1d5db;
    --color-border-focus: #0066cc;
    --color-border-error: #dc3545;

    /* ==================== TYPOGRAPHY ==================== */

    /* Font Families */
    --font-family-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-family-secondary: Georgia, 'Times New Roman', serif;
    --font-family-mono: 'Monaco', 'Courier New', monospace;

    /* Font Sizes */
    --font-size-xs: 0.75rem;
    /* 12px */
    --font-size-sm: 0.875rem;
    /* 14px */
    --font-size-base: 1rem;
    /* 16px */
    --font-size-md: 1.125rem;
    /* 18px */
    --font-size-lg: 1.25rem;
    /* 20px */
    --font-size-xl: 1.5rem;
    /* 24px */
    --font-size-2xl: 1.875rem;
    /* 30px */
    --font-size-3xl: 2.25rem;
    /* 36px */
    --font-size-4xl: 3rem;
    /* 48px */
    --font-size-5xl: 3.75rem;
    /* 60px */
    --font-size-6xl: 4.5rem;
    /* 72px */

    /* Font Weights */
    --font-weight-thin: 100;
    --font-weight-extralight: 200;
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;
    --font-weight-black: 900;

    /* Line Heights */
    --line-height-none: 1;
    --line-height-tight: 1.25;
    --line-height-snug: 1.375;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.625;
    --line-height-loose: 2;

    /* Letter Spacing */
    --letter-spacing-tighter: -0.05em;
    --letter-spacing-tight: -0.025em;
    --letter-spacing-normal: 0;
    --letter-spacing-wide: 0.025em;
    --letter-spacing-wider: 0.05em;
    --letter-spacing-widest: 0.1em;

    /* ==================== SPACING ==================== */

    --distance-0: 0;
    --distance-0p5: 0.10rem;
    --distance-1: 0.25rem;
    /* 4px */
    --distance-2: 0.5rem;
    /* 8px */
    --distance-3: 0.75rem;
    /* 12px */
    --distance-4: 1rem;
    /* 16px */
    --distance-5: 1.25rem;
    /* 20px */
    --distance-6: 1.5rem;
    /* 24px */
    --distance-7: 1.75rem;
    /* 28px */
    --distance-8: 2rem;
    /* 32px */
    --distance-9: 2.25rem;
    /* 36px */
    --distance-10: 2.5rem;
    /* 40px */
    --distance-12: 3rem;
    /* 48px */
    --distance-14: 3.5rem;
    /* 56px */
    --distance-16: 4rem;
    /* 64px */
    --distance-20: 5rem;
    /* 80px */
    --distance-24: 6rem;
    /* 96px */
    --distance-32: 8rem;
    /* 128px */
    --distance-40: 10rem;
    /* 160px */
    --distance-48: 12rem;
    /* 192px */
    --distance-56: 14rem;
    /* 224px */
    --distance-64: 16rem;
    /* 256px */

    /* ==================== SIZING ==================== */

    /* Widths */
    --width-xs: 20rem;
    /* 320px */
    --width-sm: 24rem;
    /* 384px */
    --width-md: 28rem;
    /* 448px */
    --width-lg: 32rem;
    /* 512px */
    --width-xl: 36rem;
    /* 576px */
    --width-2xl: 42rem;
    /* 672px */
    --width-3xl: 48rem;
    /* 768px */
    --width-4xl: 56rem;
    /* 896px */
    --width-5xl: 64rem;
    /* 1024px */
    --width-6xl: 72rem;
    /* 1152px */
    --width-7xl: 80rem;
    /* 1280px */
    --width-full: 100%;
    --width-screen: 100vw;

    /* Heights */
    --height-full: 100%;
    --height-screen: 100vh;
    --height-dynamic-screen: 100dvh;

    /* Max Widths */
    --max-width-xs: 20rem;
    --max-width-sm: 24rem;
    --max-width-md: 28rem;
    --max-width-lg: 32rem;
    --max-width-xl: 36rem;
    --max-width-2xl: 42rem;
    --max-width-3xl: 48rem;
    --max-width-4xl: 56rem;
    --max-width-5xl: 64rem;
    --max-width-6xl: 72rem;
    --max-width-7xl: 80rem;
    --max-width-full: 100%;

    /* ==================== BORDERS ==================== */

    /* Border Widths */
    --border-width-0: 0;
    --border-width-1: 1px;
    --border-width-2: 2px;
    --border-width-4: 4px;
    --border-width-8: 8px;

    /* Border Radius */
    --radius-none: 0;
    --radius-sm: 0.125rem;
    /* 2px */
    --radius-base: 0.25rem;
    /* 4px */
    --radius-md: 0.375rem;
    /* 6px */
    --radius-lg: 0.5rem;
    /* 8px */
    --radius-xl: 0.75rem;
    /* 12px */
    --radius-2xl: 1rem;
    /* 16px */
    --radius-3xl: 1.5rem;
    /* 24px */
    --radius-full: 9999px;

    /* ==================== SHADOWS ==================== */

    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-base: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);
    --shadow-none: none;

    /* ==================== OPACITY ==================== */

    --opacity-0: 0;
    --opacity-5: 0.05;
    --opacity-10: 0.1;
    --opacity-20: 0.2;
    --opacity-25: 0.25;
    --opacity-30: 0.3;
    --opacity-40: 0.4;
    --opacity-50: 0.5;
    --opacity-60: 0.6;
    --opacity-70: 0.7;
    --opacity-75: 0.75;
    --opacity-80: 0.8;
    --opacity-90: 0.9;
    --opacity-95: 0.95;
    --opacity-100: 1;

    /* ==================== BREAKPOINTS ==================== */

    --breakpoint-xs: 0;
    --breakpoint-sm: 640px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 1024px;
    --breakpoint-xl: 1280px;
    --breakpoint-2xl: 1536px;
}

html {
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}

@media (min-width: 700px) {
    html {
        zoom: 0.9;
        transform-origin: top center;
        user-select: auto;
        -webkit-user-select: auto;
        -ms-user-select: auto;
    }
}

button,
a,
input,
textarea {
    -webkit-tap-highlight-color: transparent;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
}

button {
    all: unset;
    border: none;
    cursor: pointer;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    padding: 0;
    font-size: inherit;
    font-weight: inherit;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
        Arial, sans-serif;

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    color: var(--color-gray-800);

    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);

    height: var(--height-screen);
}

@supports (-webkit-touch-callout: none) {
    body {
        /* The hack for Safari */
        height: -webkit-fill-available;
    }
}

svg {
    height: 26px;
    width: 26px;
    stroke-width: 1.25;
}

.app {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;

    width: var(--width-full);
    height: var(--height-full);

    /* debug */
    background-color: red;

    z-index: 1;
    transform: translateZ(0);
}

.app__main {
    display: flex;
    flex-direction: column;

    width: var(--width-full);
    height: var(--height-full);

    /* debug */
    background-color: blue;

    z-index: 1;
    transform: translateZ(0);
}

.overlay {
    position: absolute;
    width: var(--width-full);
    height: var(--height-full);
    background-color: var(--color-bg-overlay);
}

.navbar__container {
    position: sticky;
    bottom: 0;

    height: var(--distance-16);
    width: var(--width-full);

    display: flex;
    justify-content: center;

    box-sizing: border-box;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    /* TODO: Add colour as a CSS variable */
    background-color: rgba(255, 255, 255, 0.7);

    z-index: 2;
    transform: translateZ(0);

    margin-top: auto;
}

.navbar {
    display: flex;
    justify-content: space-around;
    align-items: center;

    height: var(--height-full);
    width: min(var(--width-full), var(--width-xl));

    box-sizing: border-box;
    /* background-color: green; */
}

.view {
    display: flex;
    flex-direction: column;
    /* justify-content: center; */

    width: var(--width-full);
    height: var(--height-full);

    background-color: white;

    z-index: 0;

    /* DO NOT add `transform: translateZ(0);`, it will be added in js */
}

.screen {
    position: absolute;

    display: flex;

    width: var(--width-full);
    height: var(--height-full);
}

.header__container {
    position: relative;
    margin-inline: var(--distance-2);
}

.header {
    position: absolute;

    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;

    width: min(var(--width-full), var(--width-5xl));

    border: 1px solid #d5d5d5;
    border-radius: 18px;

    left: 0;
    right: 0;
    left: 50%;
    transform: translateX(-50%);

    padding: var(--distance-3);
    margin-top: var(--distance-2);

    z-index: 1;

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    background: rgba(255, 255, 255, 0.7);
}

.header__left {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.header__back {
    margin-right: var(--distance-2);
}

.header__title-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--border-width-2);
}

.header__title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-extrabold);
}

.header__subtitle {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-gray-600);
}

.header__right {
    flex: 1;
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
}

.navbar__button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    height: var(--distance-8);
    width: var(--distance-8);
}

.navbar__button--big {
    height: var(--distance-12);
    width: var(--distance-12);
}

.navbar__button--color {
    color: var(--color-gray-400);
}

.navbar__button--color.active {
    color: var(--color-gray-950);
}

.navbar__button svg {
    stroke-width: 2;
}

.navbar__button span {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
}

#filter---sheet {
    position: absolute;
    right: 0;
    width: var(--width-full);
    height: var(--height-full);
}

.listing {
    display: grid;
    gap: var(--distance-4);
    grid-template-columns: repeat(auto-fit, minmax(var(--width-xs), 1fr));
    overflow: scroll;

    padding-inline: clamp(0.01px, calc((100% - var(--width-6xl)) / 2), 9999px);

    padding-bottom: var(--distance-16);
}

.sheet--open-towards-right {
    position: absolute;
    right: 0;
    width: var(--width-full);
    height: var(--height-full);
}

.link-button {
    color: #0066cc;
    display: flex;
    flex-direction: row;
    align-items: center;
}

.link-button--end {
    align-self: flex-end;
}

.link-button__icon {
    display: flex;
    flex-direction: column;
    align-items: center;
}