/*
 * Spineboshara.com - Main Stylesheet
 * Professional Medical Website Design System
 * Version: 1.0.0
 * Language: English
 * Mobile-First Responsive Design
 */

/* ========================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ======================================== */

:root {
    /* Color Palette - Professional Medical Blue */
    --primary-color: #2c5f8d;        /* Deep medical blue */
    --primary-dark: #1e4363;         /* Darker shade for hover states */
    --primary-light: #4a90d9;        /* Lighter shade for accents */
    
    --secondary-color: #3498db;      /* Bright blue for CTAs */
    --secondary-dark: #2980b9;       /* Darker secondary */
    --secondary-light: #5dade2;      /* Lighter secondary */
    
    --accent-color: #27ae60;         /* Green for success/trust signals */
    --accent-dark: #229954;
    
    --text-primary: #2c3e50;         /* Dark gray for body text */
    --text-secondary: #7f8c8d;       /* Medium gray for secondary text */
    --text-light: #95a5a6;           /* Light gray for subtle text */
    
    --background-primary: #ffffff;   /* White background */
    --background-secondary: #f8f9fa; /* Light gray background */
    --background-tertiary: #ecf0f1;  /* Slightly darker gray */
    
    --border-color: #dfe6e9;         /* Light border */
    --border-dark: #b2bec3;          /* Darker border */
    
    --error-color: #e74c3c;          /* Red for errors */
    --warning-color: #f39c12;        /* Orange for warnings */
    --success-color: #27ae60;        /* Green for success */
    
    /* Typography */
    --font-family-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-family-headings: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    
    --font-size-base: 16px;
    --font-size-small: 0.875rem;     /* 14px */
    --font-size-large: 1.125rem;     /* 18px */
    
    --font-size-h1: 2.5rem;          /* 40px */
    --font-size-h2: 2rem;            /* 32px */
    --font-size-h3: 1.75rem;         /* 28px */
    --font-size-h4: 1.5rem;          /* 24px */
    --font-size-h5: 1.25rem;         /* 20px */
    --font-size-h6: 1rem;            /* 16px */
    
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    --line-height-base: 1.6;
    --line-height-headings: 1.2;
    
    /* Spacing System (8px base) */
    --spacing-xs: 0.5rem;    /* 8px */
    --spacing-sm: 1rem;      /* 16px */
    --spacing-md: 1.5rem;    /* 24px */
    --spacing-lg: 2rem;      /* 32px */
    --spacing-xl: 3rem;      /* 48px */
    --spacing-xxl: 4rem;     /* 64px */
    
    /* Layout */
    --container-max-width: 1200px;
    --container-padding: 1rem;
    
    /* Border Radius */
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
    --border-radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15), 0 10px 10px rgba(0, 0, 0, 0.04);
    
    /* Transitions */
    --transition-fast: 0.15s ease-in-out;
    --transition-base: 0.3s ease-in-out;
    --transition-slow: 0.5s ease-in-out;
    
    /* Z-index Scale */
    --z-index-dropdown: 1000;
    --z-index-sticky: 1020;
    --z-index-fixed: 1030;
    --z-index-modal-backdrop: 1040;
    --z-index-modal: 1050;
    --z-index-popover: 1060;
    --z-index-tooltip: 1070;
}

/* ========================================
   RESET & BASE STYLES
   ======================================== */

/* Box sizing reset */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Remove default margins and paddings */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* HTML & Body */
html {
    font-size: var(--font-size-base);
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

body {
    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(--text-primary);
    background-color: var(--background-primary);
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

main {
    overflow-x: hidden;
    width: 100%;
}

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-headings);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-headings);
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
}

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-h5); }
h6 { font-size: var(--font-size-h6); }

p {
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color var(--transition-base);
}

a:hover,
a:focus {
    color: var(--secondary-dark);
    text-decoration: underline;
}

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

strong, b {
    font-weight: var(--font-weight-semibold);
}

em, i {
    font-style: italic;
}

/* ========================================
   LAYOUT SYSTEM
   ======================================== */

/* Container */
.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
}

/* Section Spacing */
section {
    padding: var(--spacing-xxl) 0;
    overflow-x: hidden;
    width: 100%;
}

/* Grid System */
.grid {
    display: grid;
    gap: var(--spacing-lg);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Flexbox Utilities */
.flex {
    display: flex;
}

.flex-column {
    flex-direction: column;
}

.flex-center {
    justify-content: center;
    align-items: center;
}

.flex-between {
    justify-content: space-between;
    align-items: center;
}

.flex-wrap {
    flex-wrap: wrap;
}

/* ========================================
   BUTTONS & CTAs
   ======================================== */

.btn {
    display: inline-block;
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    font-weight: var(--font-weight-medium);
    text-align: center;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    line-height: 1.5;
    max-width: 100%;
    white-space: normal;
    word-wrap: break-word;
}

.btn-primary {
    background-color: var(--secondary-color);
    color: var(--background-primary);
    border-color: var(--secondary-color);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--secondary-dark);
    border-color: var(--secondary-dark);
    color: var(--background-primary);
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: transparent;
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-secondary:hover,
.btn-secondary:focus {
    background-color: var(--secondary-color);
    color: var(--background-primary);
    text-decoration: none;
    transform: translateY(-2px);
}

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

/* Skip to main content link */
.skip-to-main {
    position: absolute;
    top: -100px;
    left: 0;
    background-color: var(--primary-color);
    color: var(--background-primary);
    padding: var(--spacing-sm) var(--spacing-md);
    text-decoration: none;
    z-index: var(--z-index-tooltip);
}

.skip-to-main:focus {
    top: 0;
}

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

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

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

/* Text Colors */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-light { color: var(--text-light); }

/* Background Colors */
.bg-primary { background-color: var(--background-primary); }
.bg-secondary { background-color: var(--background-secondary); }
.bg-tertiary { background-color: var(--background-tertiary); }

/* Spacing Utilities */
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }

.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }

.pt-sm { padding-top: var(--spacing-sm); }
.pt-md { padding-top: var(--spacing-md); }
.pt-lg { padding-top: var(--spacing-lg); }
.pt-xl { padding-top: var(--spacing-xl); }

.pb-sm { padding-bottom: var(--spacing-sm); }
.pb-md { padding-bottom: var(--spacing-md); }
.pb-lg { padding-bottom: var(--spacing-lg); }
.pb-xl { padding-bottom: var(--spacing-xl); }

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

/* Mobile First Approach */
/* Base styles above are for mobile (< 768px) */

/* Tablet (768px and up) */
@media (min-width: 768px) {
    :root {
        --font-size-h1: 3rem;      /* 48px */
        --font-size-h2: 2.5rem;    /* 40px */
        --font-size-h3: 2rem;      /* 32px */
        --container-padding: 2rem;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop (1024px and up) */
@media (min-width: 1024px) {
    :root {
        --font-size-h1: 3.5rem;    /* 56px */
        --font-size-h2: 2.75rem;   /* 44px */
        --font-size-h3: 2.25rem;   /* 36px */
    }

    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }

    .btn {
        padding: var(--spacing-sm) var(--spacing-lg);
        font-size: var(--font-size-base);
    }
}

/* Large Desktop (1280px and up) */
@media (min-width: 1280px) {
    section {
        padding: var(--spacing-xxl) 0;
    }
}

/* ========================================
   IMAGES & MEDIA
   ======================================== */

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

picture {
    display: block;
}

/* Lazy loading placeholder */
img[loading="lazy"] {
    background-color: var(--background-tertiary);
}

/* ========================================
   CARDS & COMPONENTS
   ======================================== */

.card {
    background-color: var(--background-primary);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-lg);
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.card-title {
    font-size: var(--font-size-h4);
    margin-bottom: var(--spacing-sm);
}

.card-text {
    color: var(--text-secondary);
    line-height: var(--line-height-base);
}

/* ========================================
   SECTION TITLES
   ======================================== */

.section-title {
    font-size: var(--font-size-h2);
    color: var(--primary-color);
    text-align: center;
    margin-bottom: var(--spacing-xl);
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--secondary-color);
    margin: var(--spacing-md) auto 0;
    border-radius: var(--border-radius-full);
}

.section-subtitle {
    font-size: var(--font-size-large);
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

/* ========================================
   ANIMATIONS (GPU-accelerated)
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in {
    animation: fadeIn var(--transition-slow) ease-out;
}

.slide-in-left {
    animation: slideInLeft var(--transition-slow) ease-out;
}

.slide-in-right {
    animation: slideInRight var(--transition-slow) ease-out;
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    *,
    *::before,
    *::after {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

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

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

    img {
        page-break-inside: avoid;
    }

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

