/* ==========================================================================
   Base CSS - Reset, Variables, Typography, Global Styles
   ========================================================================== */

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

html {
    line-height: 1.15;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-base);
    color: var(--color-text-primary);
    background-color: var(--color-background-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Remove default list styles */
ul,
ol {
    list-style: none;
}

/* Remove default link styles */
a {
    color: inherit;
    text-decoration: none;
}

/* Remove default button styles */
button {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    font-family: inherit;
}

/* Remove default form element styles */
input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
}

/* Images */
img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* ==========================================================================
   CSS Custom Properties (Variables)
   ========================================================================== */

:root {
    /* Colors - Based on screenshots and proposal */
    --color-primary-blue: #4a90e2;
    --color-secondary-orange: #f5a623;
    --color-accent-green: #7ed321;

    --color-neutral-white: #ffffff;
    --color-neutral-light: #f8f9fa;
    --color-neutral-medium: #6c757d;
    --color-neutral-dark: #343a40;
    --color-neutral-black: #000000;

    /* Semantic color mapping */
    --color-background-primary: var(--color-neutral-white);
    --color-background-secondary: var(--color-neutral-light);
    --color-text-primary: var(--color-neutral-dark);
    --color-text-secondary: var(--color-neutral-medium);
    --color-text-inverse: var(--color-neutral-white);

    /* Button colors */
    --color-button-primary: #2463eb;
    --color-button-primary-hover: #1d4ed8;
    --color-button-secondary: var(--color-secondary-orange);
    --color-button-accent: var(--color-accent-green);

    /* Category card colors - light tinted backgrounds */
    --color-card-store: #f0f7ff;
    --color-card-store-border: #dbeafe;
    --color-card-restaurant: #fef9f3;
    --color-card-restaurant-border: #fef3c7;
    --color-card-support: #f0fdf4;
    --color-card-support-border: #dcfce7;

    /* Icon background colors */
    --color-icon-bg-blue: #dbe9fe;
    --color-icon-bg-orange: #fef3c7;
    --color-icon-bg-green: #d1fae5;

    /* Icon stroke colors */
    --color-icon-stroke-blue: #2463eb;
    --color-icon-stroke-orange: #d97708;
    --color-icon-stroke-green: #079669;

    /* Typography */
    --font-family-primary: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-family-secondary: var(--font-family-primary);

    /* Font sizes - Using clamp for fluid typography */
    --font-size-xs: 0.75rem; /* 12px */
    --font-size-sm: 0.875rem; /* 14px */
    --font-size-base: 1rem; /* 16px */
    --font-size-lg: 1.125rem; /* 18px */
    --font-size-xl: 1.25rem; /* 20px */
    --font-size-2xl: 1.5rem; /* 24px */
    --font-size-3xl: 1.875rem; /* 30px */
    --font-size-4xl: 2.25rem; /* 36px */
    --font-size-5xl: 3rem; /* 48px */

    /* Fluid heading sizes */
    --font-size-h1: clamp(2.25rem, 4vw, 3rem); /* 36px - 48px */
    --font-size-h2: clamp(1.875rem, 3vw, 2.25rem); /* 30px - 36px */
    --font-size-h3: clamp(1.5rem, 2.5vw, 1.875rem); /* 24px - 30px */
    --font-size-h4: clamp(1.25rem, 2vw, 1.5rem); /* 20px - 24px */

    /* Line heights */
    --line-height-tight: 1.2;
    --line-height-base: 1.5;
    --line-height-relaxed: 1.75;

    /* Font weights */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* Spacing scale */
    --spacing-xs: 0.25rem; /* 4px */
    --spacing-sm: 0.5rem; /* 8px */
    --spacing-md: 0.75rem; /* 12px */
    --spacing-lg: 1rem; /* 16px */
    --spacing-xl: 1.5rem; /* 24px */
    --spacing-2xl: 2rem; /* 32px */
    --spacing-3xl: 2.5rem; /* 40px */
    --spacing-4xl: 3rem; /* 48px */
    --spacing-5xl: 4rem; /* 64px */
    --spacing-6xl: 5rem; /* 80px */

    /* Border radius */
    --radius-sm: 0.25rem; /* 4px */
    --radius-md: 0.5rem; /* 8px */
    --radius-lg: 0.75rem; /* 12px */
    --radius-xl: 1rem; /* 16px */
    --radius-2xl: 1.5rem; /* 24px */
    --radius-full: 50%;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.25);

    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;

    /* Z-index scale */
    --z-dropdown: 1000;
    --z-sticky: 1010;
    --z-fixed: 1020;
    --z-modal-backdrop: 1030;
    --z-modal: 1040;
    --z-popover: 1050;
    --z-tooltip: 1060;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-lg);
}

h1 {
    font-size: var(--font-size-h1);
}

h2 {
    font-size: var(--font-size-h2);
}

h3 {
    font-size: var(--font-size-h3);
}

h4 {
    font-size: var(--font-size-h4);
}

h5 {
    font-size: var(--font-size-xl);
}

h6 {
    font-size: var(--font-size-lg);
}

p {
    margin-bottom: var(--spacing-lg);
    line-height: var(--line-height-base);
}

/* Links */
a {
    transition: color var(--transition-fast);
}

a:hover {
    opacity: 0.8;
}

/* Strong and emphasis */
strong,
b {
    font-weight: var(--font-weight-bold);
}

em,
i {
    font-style: italic;
}

/* Small text */
small {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

/* Code */
code {
    font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
    font-size: 0.9em;
    padding: 0.1em 0.3em;
    background-color: var(--color-neutral-light);
    border-radius: var(--radius-sm);
}

/* Selection */
::selection {
    background-color: var(--color-primary-blue);
    color: var(--color-neutral-white);
}

::-moz-selection {
    background-color: var(--color-primary-blue);
    color: var(--color-neutral-white);
}

/* Focus styles */
:focus {
    outline: 2px solid var(--color-primary-blue);
    outline-offset: 2px;
}

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

/* ==========================================================================
   Accessibility
   ========================================================================== */

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   Print styles
   ========================================================================== */

@media print {
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    a,
    a:visited {
        text-decoration: underline;
    }

    a[href]:after {
        content: " (" attr(href) ")";
    }

    abbr[title]:after {
        content: " (" attr(title) ")";
    }

    pre,
    blockquote {
        border: 1px solid #999;
        page-break-inside: avoid;
    }

    thead {
        display: table-header-group;
    }

    tr,
    img {
        page-break-inside: avoid;
    }

    img {
        max-width: 100% !important;
    }

    p,
    h2,
    h3 {
        orphans: 3;
        widows: 3;
    }

    h2,
    h3 {
        page-break-after: avoid;
    }
}
