/* ===================================
   BASE CSS - Velvet Paws Cat Grooming
   Global Foundation & Design System
   Version: 2.1 - Contrast Fixed
   =================================== */

/* === GLOBAL SCROLL FIX === */
* {
    box-sizing: border-box;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* === CSS VARIABLES - CONTRAST FIXED === */
:root {
    /* Brand Colors - IMPROVED CONTRAST */
    --purple: #7C3AED; /* Darkened from #8B5CF6 */
    --purple-dark: #6D28D9; /* Darkened from #7C3AED */
    --purple-light: #A78BFA;
    --purple-lighter: #DDD6FE;
    --purple-lightest: #EDE9FE;
    --pink: #DB2777; /* Darkened from #EC4899 */
    --pink-light: #F9A8D4;
    --pink-dark: #BE185D; /* Darkened from #DB2777 */
    
    /* Neutral Colors - IMPROVED CONTRAST */
    --dark: #1F2937;
    --gray-dark: #374151; /* Darkened from #4B5563 */
    --gray: #4B5563; /* Darkened from #6B7280 */
    --gray-light: #6B7280; /* Previously was #9CA3AF */
    --gray-lighter: #E5E7EB;
    --light: #F9FAFB;
    --white: #FFFFFF;
    
    /* Semantic Colors */
    --green: #059669; /* Darkened from #10B981 */
    --green-light: #34D399;
    --green-dark: #047857; /* Darkened from #059669 */
    --blue: #2563EB; /* Darkened from #3B82F6 */
    --blue-light: #60A5FA;
    --yellow: #D97706; /* Darkened from #F59E0B */
    --yellow-light: #FCD34D;
    --red: #DC2626; /* Darkened from #EF4444 */
    --red-light: #F87171;
    
    /* Shadows - Consolidated */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 15px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 50px rgba(0,0,0,0.15);
    --shadow-2xl: 0 25px 60px rgba(0,0,0,0.2);
    --shadow-inner: inset 0 2px 4px 0 rgba(0,0,0,0.06);
    
    /* Border Radius - Unified */
    --radius-sm: 6px;
    --radius: 12px;
    --radius-lg: 20px;
    --radius-xl: 30px;
    --radius-full: 9999px;
    
    /* Transitions - Standardized */
    --transition-fast: all 0.15s ease;
    --transition: all 0.3s ease;
    --transition-slow: all 0.5s ease;
    --transition-cubic: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Spacing System */
    --container-max: 1200px;
    --container-padding: 20px;
    --section-padding: 5rem;
    --section-padding-mobile: 3rem;
    --touch-target: 44px;
    --mobile-padding: 1rem;
    --desktop-padding: 2rem;
    
    /* Typography Scale */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 2rem;
    --text-4xl: 2.5rem;
    --text-5xl: 3rem;
    --text-6xl: 3.5rem;
    
    /* Line Heights */
    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 2;
    
    /* Z-Index Scale - Extended for all uses */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-tooltip: 700;
    --z-notification: 800;
    --z-booking: 9999;
    --z-critical: 10000;
    
    /* Breakpoints - Centralized */
    --breakpoint-xs: 480px;
    --breakpoint-sm: 640px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 1024px;
    --breakpoint-xl: 1280px;
    --breakpoint-2xl: 1536px;
}

/* === RESET & NORMALIZE === */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
    overflow-x: hidden;
    position: relative;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: var(--text-base);
    font-weight: 400;
    line-height: var(--leading-relaxed);
    color: var(--dark);
    background-color: var(--white);
    overflow-x: hidden;
    position: relative;
    width: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Prevent horizontal scroll on all major containers */
main,
section {
    overflow-x: hidden;
    position: relative;
    width: 100%;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
    margin: 0 0 1rem;
    font-weight: 700;
    line-height: var(--leading-tight);
    color: var(--dark);
}

h1 {
    font-size: var(--text-5xl);
    letter-spacing: -0.025em;
}

h2 {
    font-size: var(--text-4xl);
    letter-spacing: -0.025em;
}

h3 {
    font-size: var(--text-3xl);
    letter-spacing: -0.025em;
}

h4 {
    font-size: var(--text-2xl);
}

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

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

p {
    margin: 0 0 1rem;
    line-height: var(--leading-relaxed);
}

p:last-child {
    margin-bottom: 0;
}

/* Links */
a {
    color: var(--purple);
    text-decoration: underline;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--purple-dark);
    text-decoration: none;
}

a:focus {
    outline: 2px solid var(--purple);
    outline-offset: 2px;
}

/* Lists */
ul, ol {
    margin: 0 0 1rem;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
}

li:last-child {
    margin-bottom: 0;
}

/* Blockquotes */
blockquote {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--light);
    border-left: 4px solid var(--purple);
    font-style: italic;
    color: var(--gray-dark);
    border-radius: var(--radius);
}

blockquote p:last-child {
    margin-bottom: 0;
}

/* Code */
code {
    padding: 0.125rem 0.375rem;
    background: var(--gray-lighter);
    border-radius: var(--radius-sm);
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.875em;
}

pre {
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--gray-lighter);
    border-radius: var(--radius);
    overflow-x: auto;
}

pre code {
    padding: 0;
    background: transparent;
}

/* Horizontal Rule */
hr {
    margin: 3rem 0;
    border: 0;
    border-top: 1px solid var(--gray-lighter);
}

/* === LAYOUT UTILITIES === */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    overflow-x: hidden;
    position: relative;
}

.container-fluid {
    width: 100%;
    padding: 0 var(--container-padding);
}

/* Section Spacing */
section {
    padding: var(--section-padding) 0;
}

.section-sm {
    padding: calc(var(--section-padding) * 0.5) 0;
}

.section-lg {
    padding: calc(var(--section-padding) * 1.5) 0;
}

/* Section Headers - Base Definition */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    margin-bottom: 1rem;
    font-size: var(--text-4xl);
}

.section-header p {
    font-size: var(--text-lg);
    color: var(--gray-dark); /* Improved contrast */
    max-width: 600px;
    margin: 0 auto;
}

/* === GRID SYSTEM === */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.75rem;
    margin-left: -0.75rem;
}

.col {
    flex: 1 0 0%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

/* Column Sizes */
.col-1 { flex: 0 0 auto; width: 8.333333%; }
.col-2 { flex: 0 0 auto; width: 16.666667%; }
.col-3 { flex: 0 0 auto; width: 25%; }
.col-4 { flex: 0 0 auto; width: 33.333333%; }
.col-5 { flex: 0 0 auto; width: 41.666667%; }
.col-6 { flex: 0 0 auto; width: 50%; }
.col-7 { flex: 0 0 auto; width: 58.333333%; }
.col-8 { flex: 0 0 auto; width: 66.666667%; }
.col-9 { flex: 0 0 auto; width: 75%; }
.col-10 { flex: 0 0 auto; width: 83.333333%; }
.col-11 { flex: 0 0 auto; width: 91.666667%; }
.col-12 { flex: 0 0 auto; width: 100%; }

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

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

/* Flexbox */
.flex-row { flex-direction: row !important; }
.flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.justify-start { justify-content: flex-start !important; }
.justify-center { justify-content: center !important; }
.justify-end { justify-content: flex-end !important; }
.justify-between { justify-content: space-between !important; }
.align-start { align-items: flex-start !important; }
.align-center { align-items: center !important; }
.align-end { align-items: flex-end !important; }
.gap-1 { gap: 0.5rem !important; }
.gap-2 { gap: 1rem !important; }
.gap-3 { gap: 1.5rem !important; }
.gap-4 { gap: 2rem !important; }

/* Text Alignment */
.text-left { text-align: left !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }

/* Text Colors */
.text-primary { color: var(--purple) !important; }
.text-secondary { color: var(--pink) !important; }
.text-success { color: var(--green) !important; }
.text-danger { color: var(--red) !important; }
.text-warning { color: var(--yellow) !important; }
.text-info { color: var(--blue) !important; }
.text-dark { color: var(--dark) !important; }
.text-gray { color: var(--gray-dark) !important; } /* Improved contrast */
.text-light { color: var(--gray) !important; } /* Improved contrast */
.text-white { color: var(--white) !important; }

/* Text Sizes */
.text-xs { font-size: var(--text-xs) !important; }
.text-sm { font-size: var(--text-sm) !important; }
.text-base { font-size: var(--text-base) !important; }
.text-lg { font-size: var(--text-lg) !important; }
.text-xl { font-size: var(--text-xl) !important; }

/* Font Weight */
.font-normal { font-weight: 400 !important; }
.font-medium { font-weight: 500 !important; }
.font-semibold { font-weight: 600 !important; }
.font-bold { font-weight: 700 !important; }

/* Background Colors */
.bg-primary { background-color: var(--purple) !important; }
.bg-secondary { background-color: var(--pink) !important; }
.bg-success { background-color: var(--green) !important; }
.bg-danger { background-color: var(--red) !important; }
.bg-warning { background-color: var(--yellow) !important; }
.bg-info { background-color: var(--blue) !important; }
.bg-dark { background-color: var(--dark) !important; }
.bg-light { background-color: var(--light) !important; }
.bg-white { background-color: var(--white) !important; }

/* Margins */
.m-0 { margin: 0 !important; }
.m-1 { margin: 0.5rem !important; }
.m-2 { margin: 1rem !important; }
.m-3 { margin: 1.5rem !important; }
.m-4 { margin: 2rem !important; }
.m-5 { margin: 3rem !important; }
.m-auto { margin: auto !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.5rem !important; }
.mt-2 { margin-top: 1rem !important; }
.mt-3 { margin-top: 1.5rem !important; }
.mt-4 { margin-top: 2rem !important; }
.mt-5 { margin-top: 3rem !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.5rem !important; }
.mb-2 { margin-bottom: 1rem !important; }
.mb-3 { margin-bottom: 1.5rem !important; }
.mb-4 { margin-bottom: 2rem !important; }
.mb-5 { margin-bottom: 3rem !important; }

.ml-0 { margin-left: 0 !important; }
.ml-1 { margin-left: 0.5rem !important; }
.ml-2 { margin-left: 1rem !important; }
.ml-3 { margin-left: 1.5rem !important; }
.ml-4 { margin-left: 2rem !important; }
.ml-5 { margin-left: 3rem !important; }

.mr-0 { margin-right: 0 !important; }
.mr-1 { margin-right: 0.5rem !important; }
.mr-2 { margin-right: 1rem !important; }
.mr-3 { margin-right: 1.5rem !important; }
.mr-4 { margin-right: 2rem !important; }
.mr-5 { margin-right: 3rem !important; }

.mx-0 { margin-left: 0 !important; margin-right: 0 !important; }
.mx-1 { margin-left: 0.5rem !important; margin-right: 0.5rem !important; }
.mx-2 { margin-left: 1rem !important; margin-right: 1rem !important; }
.mx-3 { margin-left: 1.5rem !important; margin-right: 1.5rem !important; }
.mx-4 { margin-left: 2rem !important; margin-right: 2rem !important; }
.mx-5 { margin-left: 3rem !important; margin-right: 3rem !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }

.my-0 { margin-top: 0 !important; margin-bottom: 0 !important; }
.my-1 { margin-top: 0.5rem !important; margin-bottom: 0.5rem !important; }
.my-2 { margin-top: 1rem !important; margin-bottom: 1rem !important; }
.my-3 { margin-top: 1.5rem !important; margin-bottom: 1.5rem !important; }
.my-4 { margin-top: 2rem !important; margin-bottom: 2rem !important; }
.my-5 { margin-top: 3rem !important; margin-bottom: 3rem !important; }

/* Padding */
.p-0 { padding: 0 !important; }
.p-1 { padding: 0.5rem !important; }
.p-2 { padding: 1rem !important; }
.p-3 { padding: 1.5rem !important; }
.p-4 { padding: 2rem !important; }
.p-5 { padding: 3rem !important; }

.pt-0 { padding-top: 0 !important; }
.pt-1 { padding-top: 0.5rem !important; }
.pt-2 { padding-top: 1rem !important; }
.pt-3 { padding-top: 1.5rem !important; }
.pt-4 { padding-top: 2rem !important; }
.pt-5 { padding-top: 3rem !important; }

.pb-0 { padding-bottom: 0 !important; }
.pb-1 { padding-bottom: 0.5rem !important; }
.pb-2 { padding-bottom: 1rem !important; }
.pb-3 { padding-bottom: 1.5rem !important; }
.pb-4 { padding-bottom: 2rem !important; }
.pb-5 { padding-bottom: 3rem !important; }

.pl-0 { padding-left: 0 !important; }
.pl-1 { padding-left: 0.5rem !important; }
.pl-2 { padding-left: 1rem !important; }
.pl-3 { padding-left: 1.5rem !important; }
.pl-4 { padding-left: 2rem !important; }
.pl-5 { padding-left: 3rem !important; }

.pr-0 { padding-right: 0 !important; }
.pr-1 { padding-right: 0.5rem !important; }
.pr-2 { padding-right: 1rem !important; }
.pr-3 { padding-right: 1.5rem !important; }
.pr-4 { padding-right: 2rem !important; }
.pr-5 { padding-right: 3rem !important; }

.px-0 { padding-left: 0 !important; padding-right: 0 !important; }
.px-1 { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
.px-2 { padding-left: 1rem !important; padding-right: 1rem !important; }
.px-3 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
.px-4 { padding-left: 2rem !important; padding-right: 2rem !important; }
.px-5 { padding-left: 3rem !important; padding-right: 3rem !important; }

.py-0 { padding-top: 0 !important; padding-bottom: 0 !important; }
.py-1 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.py-2 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.py-3 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
.py-4 { padding-top: 2rem !important; padding-bottom: 2rem !important; }
.py-5 { padding-top: 3rem !important; padding-bottom: 3rem !important; }

/* Borders */
.border { border: 1px solid var(--gray-lighter) !important; }
.border-0 { border: 0 !important; }
.border-primary { border-color: var(--purple) !important; }
.border-secondary { border-color: var(--pink) !important; }
.border-success { border-color: var(--green) !important; }
.border-danger { border-color: var(--red) !important; }
.border-warning { border-color: var(--yellow) !important; }

.rounded { border-radius: var(--radius) !important; }
.rounded-sm { border-radius: var(--radius-sm) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-xl { border-radius: var(--radius-xl) !important; }
.rounded-full { border-radius: var(--radius-full) !important; }
.rounded-0 { border-radius: 0 !important; }

/* Shadows */
.shadow-none { box-shadow: none !important; }
.shadow-xs { box-shadow: var(--shadow-xs) !important; }
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }
.shadow-xl { box-shadow: var(--shadow-xl) !important; }
.shadow-2xl { box-shadow: var(--shadow-2xl) !important; }

/* Width & Height */
.w-100 { width: 100% !important; }
.w-75 { width: 75% !important; }
.w-50 { width: 50% !important; }
.w-25 { width: 25% !important; }
.w-auto { width: auto !important; }
.w-full { width: 100% !important; }

.h-100 { height: 100% !important; }
.h-75 { height: 75% !important; }
.h-50 { height: 50% !important; }
.h-25 { height: 25% !important; }
.h-auto { height: auto !important; }
.h-full { height: 100% !important; }

/* Min/Max Width & Height */
.min-w-0 { min-width: 0 !important; }
.max-w-full { max-width: 100% !important; }
.min-h-0 { min-height: 0 !important; }
.max-h-full { max-height: 100% !important; }

/* Overflow */
.overflow-auto { overflow: auto !important; }
.overflow-hidden { overflow: hidden !important; }
.overflow-visible { overflow: visible !important; }
.overflow-scroll { overflow: scroll !important; }
.overflow-x-auto { overflow-x: auto !important; }
.overflow-x-hidden { overflow-x: hidden !important; }
.overflow-y-auto { overflow-y: auto !important; }
.overflow-y-hidden { overflow-y: hidden !important; }

/* Position */
.static { position: static !important; }
.fixed { position: fixed !important; }
.absolute { position: absolute !important; }
.relative { position: relative !important; }
.sticky { position: sticky !important; }

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

/* === RESPONSIVE UTILITIES === */

/* Mobile First Breakpoints */
@media (min-width: 640px) {
    /* sm: utilities */
}

@media (min-width: 768px) {
    /* md: utilities */
    section {
        padding: var(--section-padding) 0;
    }
}

@media (min-width: 1024px) {
    /* lg: utilities */
}

@media (min-width: 1280px) {
    /* xl: utilities */
}

/* === ACCESSIBILITY === */

/* Skip to content */
.skip-to-content {
    position: absolute;
    left: -9999px;
    z-index: 999;
    padding: 1rem 1.5rem;
    background-color: var(--purple);
    color: var(--white);
    text-decoration: none;
    border-radius: var(--radius);
}

.skip-to-content:focus {
    left: 50%;
    transform: translateX(-50%);
    top: 1rem;
    outline: 2px solid var(--white);
    outline-offset: 2px;
}

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

/* 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 === */
@media (prefers-contrast: high) {
    :root {
        --shadow-sm: 0 1px 2px rgba(0,0,0,0.5);
        --shadow-md: 0 4px 6px rgba(0,0,0,0.5);
        --shadow-lg: 0 8px 12px rgba(0,0,0,0.5);
    }
    
    * {
        border-color: currentColor !important;
    }
}

/* === DARK MODE PREPARATION === */
@media (prefers-color-scheme: dark) {
    /* Future dark mode styles can be added here */
}

/* === TOUCH DEVICE OPTIMIZATIONS === */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets */
    button,
    a,
    input,
    select,
    textarea {
        min-height: var(--touch-target);
        min-width: var(--touch-target);
    }
}

/* === UTILITY: VISUALLY HIDDEN BUT ACCESSIBLE === */
.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;
}

/* === SMOOTH SCROLLING === */
.smooth-scroll {
    scroll-behavior: smooth;
}

/* === NO SCROLL (BODY) === */
.no-scroll {
    overflow: hidden !important;
}

/* === LOADING STATES === */
.loading {
    pointer-events: none;
    opacity: 0.6;
}

/* === SELECTION COLORS === */
::selection {
    background-color: var(--purple);
    color: var(--white);
}

::-moz-selection {
    background-color: var(--purple);
    color: var(--white);
}

/* === PLACEHOLDER STYLES === */
::placeholder {
    color: var(--gray);
    opacity: 1;
}

:-ms-input-placeholder {
    color: var(--gray);
}

::-ms-input-placeholder {
    color: var(--gray);
}

/* === SCROLLBAR STYLING === */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-lighter);
}

::-webkit-scrollbar-thumb {
    background: var(--gray);
    border-radius: var(--radius-sm);
}

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

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

/* === END OF BASE.CSS === */
