/**
 * Beach Luxe Vacations - Base Styles
 * 
 * Core reset and base element styles.
 * Typography is handled separately in typography.css
 */

/* ============================================================================
   CSS RESET (Modern Minimal Reset)
   ============================================================================ */

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

/* Prevent font size inflation on mobile */
html {
    -moz-text-size-adjust: none;
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
}

/* Remove default margin and set core body defaults */
body {
    min-height: 100vh;
    line-height: var(--leading-normal);
    font-family: var(--font-body);
    color: var(--color-text);
    background-color: var(--color-background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Remove list styles globally */
ul, ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

li {
    list-style: none;
}

/* Set core root defaults */
html:focus-within {
    scroll-behavior: smooth;
}

/* Balance text wrapping on headings */
h1, h2, h3, h4 {
    text-wrap: balance;
}

/* Remove default button styles */
button {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
}

/* Improve media defaults */
img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
    font: inherit;
}

/* Make sure textareas without a rows attribute are not tiny */
textarea:not([rows]) {
    min-height: 10em;
}

/* Anything that has been anchored to should have extra scroll margin */
:target {
    scroll-margin-block: 5ex;
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

/* Skip link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    z-index: var(--z-notification);
    padding: var(--space-3) var(--space-4);
    background-color: var(--color-primary);
    color: var(--color-white);
    font-weight: var(--font-weight-semibold);
    text-decoration: none;
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 0;
}

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

/* Remove focus outline for mouse users */
:focus:not(:focus-visible) {
    outline: none;
}

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

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --color-border: var(--color-gray-700);
    }
    
    button,
    input,
    select,
    textarea {
        border: 2px solid currentColor;
    }
}

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

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ============================================================================
   FORMS BASE
   ============================================================================ */

input,
textarea,
select {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--color-text);
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(2, 103, 136, 0.1);
    outline: none;
}

input::placeholder,
textarea::placeholder {
    color: var(--color-text-muted);
}

input:disabled,
textarea:disabled,
select:disabled {
    background-color: var(--color-surface);
    cursor: not-allowed;
    opacity: 0.6;
}

label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

/* ============================================================================
   SELECTION
   ============================================================================ */

::selection {
    background-color: var(--color-primary-light);
    color: var(--color-white);
}

/* ============================================================================
   SCROLLBAR (WebKit)
   ============================================================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-surface);
}

::-webkit-scrollbar-thumb {
    background: var(--color-gray-400);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-gray-500);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-gray-400) var(--color-surface);
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.container {
    width: 100%;
    max-width: var(--container-xl);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-4);
    padding-right: var(--space-4);
}

@media (min-width: 640px) {
    .container {
        padding-left: var(--space-6);
        padding-right: var(--space-6);
    }
}

@media (min-width: 1024px) {
    .container {
        padding-left: var(--space-8);
        padding-right: var(--space-8);
    }
}

/* Display utilities */
.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }

/* Flex utilities */
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Spacing utilities */
.m-0 { margin: 0; }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-10 { margin-bottom: var(--space-10); }
.mb-12 { margin-bottom: var(--space-12); }

.p-0 { padding: 0; }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-8 { padding-top: var(--space-8); padding-bottom: var(--space-8); }
.py-12 { padding-top: var(--space-12); padding-bottom: var(--space-12); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }

/* Width utilities */
.w-full { width: 100%; }
.max-w-lg { max-width: var(--container-lg); }
.max-w-xl { max-width: var(--container-xl); }

/* Border radius */
.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

/* Shadows */
.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* Transitions */
.transition { transition: all var(--transition-normal); }

/* Text utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-muted { color: var(--color-text-muted); }
.text-light { color: var(--color-text-light); }
.text-primary { color: var(--color-primary); }
.text-white { color: var(--color-white); }

/* Container variants */
.container-narrow {
    max-width: var(--container-md);
}

/* Icon circles (for feature sections) */
.icon-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--color-white) 0%, var(--color-surface) 100%);
    border: 1px solid var(--color-border);
    color: var(--color-primary);
    margin-left: auto;
    margin-right: auto;
    margin-bottom: var(--space-10);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    transition: all var(--transition-normal);
}

.icon-circle svg {
    width: 32px;
    height: 32px;
    transition: transform var(--transition-normal);
}

/* Feature cards for Why Beach Luxe section */
.feature-card {
    padding: var(--space-8) var(--space-6) var(--space-6);
    border-radius: var(--radius-xl);
    transition: all var(--transition-normal);
    cursor: default;
}

.feature-card .icon-circle {
    margin-bottom: var(--space-10);
}

.feature-card h3 {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-3);
    transition: color var(--transition-fast);
}

.feature-card p {
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    max-width: 280px;
    margin: 0 auto;
}

/* Hover effect for feature cards */
.feature-card:hover {
    background-color: var(--color-white);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.feature-card:hover .icon-circle {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: var(--color-white);
    border-color: transparent;
    box-shadow: 0 8px 24px rgba(2, 103, 136, 0.25);
    transform: translateY(-2px);
}

.feature-card:hover .icon-circle svg {
    transform: scale(1.05);
}

.feature-card:hover h3 {
    color: var(--color-primary);
}

/* Background utilities */
.bg-white { background-color: var(--color-white); }
.bg-surface { background-color: var(--color-surface); }
.bg-primary { background-color: var(--color-primary); }

/* Section divider - elegant gold line */
.section-divider {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
    margin: 0 auto var(--space-6);
    opacity: 0.6;
}
