/* ============================================
   DESIGN SYSTEM - Site Diagnosis Pro
   ============================================ */

:root {
    /* Colors */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #dbeafe;
    
    --secondary: #8b5cf6;
    --secondary-hover: #7c3aed;
    
    --success: #10b981;
    --success-light: #d1fae5;
    
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    
    --danger: #ef4444;
    --danger-light: #fee2e2;
    
    --info: #06b6d4;
    --info-light: #cffafe;
    
    /* Grays */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --gradient-pink: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   BASE STYLES
   ============================================ */

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

body {
    font-family: var(--font-sans);
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
}

/* ============================================
   NAVIGATION
   ============================================ */

.navbar {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: var(--space-md) 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.navbar .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: var(--font-size-xl);
    font-weight: 700;
    text-decoration: none;
    color: var(--gray-900);
    transition: color var(--transition-fast);
}

.nav-brand:hover {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: var(--space-lg);
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--gray-600);
    font-weight: 500;
    transition: color var(--transition-fast);
    position: relative;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a.active {
    color: var(--primary);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

.user-info {
    color: var(--gray-600);
    font-size: var(--font-size-sm);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    border: none;
    font-weight: 600;
    font-size: var(--font-size-base);
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-secondary:hover {
    background: var(--secondary-hover);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-outline {
    background: white;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-gradient {
    background: var(--gradient-pink);
    color: white;
    border: none;
}

.btn-sm {
    padding: var(--space-xs) var(--space-md);
    font-size: var(--font-size-sm);
}

.btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: var(--font-size-lg);
}

/* ============================================
   CARDS
   ============================================ */

.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: all var(--transition-base);
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--gray-200);
}

.card-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--gray-900);
}

.card-body {
    color: var(--gray-700);
}

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

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: var(--space-md);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    transition: all var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* ============================================
   BADGES
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

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

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.text-center {
    text-align: center;
}

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

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

.loading {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--gray-400);
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .card {
        padding: var(--space-lg);
    }
}


/* ============================================
   MOBILE RESPONSIVE ENHANCEMENTS
   ============================================ */

@media (max-width: 768px) {
    /* Navigation */
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
        font-size: 0.9rem;
    }
    
    /* Buttons */
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .btn-sm {
        width: auto;
        min-width: 80px;
    }
    
    /* Cards */
    .card {
        padding: 1.25rem;
    }
    
    /* Forms */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="url"],
    textarea {
        font-size: 16px; /* Prevents iOS zoom */
    }
    
    /* Stats grid */
    .stats-row {
        grid-template-columns: 1fr 1fr !important;
        gap: 1rem;
    }
    
    /* Main grid */
    .main-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Pricing cards */
    .pricing-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Footer */
    footer > div > div {
        grid-template-columns: 1fr !important;
        text-align: center;
    }
    
    footer ul {
        text-align: center;
    }
    
    /* Comparison table - make scrollable */
    .comparison-table {
        overflow-x: auto;
    }
    
    .comparison-table table {
        min-width: 600px;
    }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }
    
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* ============================================
   TOUCH TARGET OPTIMIZATION (44px minimum)
   ============================================ */

/* Ensure all interactive elements are at least 44px */
button,
.btn,
a.btn,
input[type="submit"],
input[type="button"] {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
}

/* Links with padding for better touch targets */
a {
    position: relative;
}

nav a,
.nav-links a,
.mobile-menu-link {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
}

/* Form controls */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="tel"],
input[type="number"],
input[type="search"],
select,
textarea {
    min-height: 44px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Larger tap targets on mobile */
@media (max-width: 767px) {
    input,
    select,
    textarea,
    button {
        font-size: 16px; /* Prevents iOS zoom */
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .btn-sm {
        min-height: 40px;
        width: auto;
    }
}

/* ============================================
   MOBILE-OPTIMIZED TYPOGRAPHY
   ============================================ */

/* Fluid typography */
html {
    font-size: 16px;
}

h1 {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    line-height: 1.2;
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    line-height: 1.3;
}

h3 {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    line-height: 1.4;
}

body {
    font-size: 1rem;
    line-height: 1.6;
}

/* Better readability on mobile */
@media (max-width: 767px) {
    body {
        font-size: 1rem;
        line-height: 1.5;
    }
    
    p {
        margin-bottom: 1rem;
    }
    
    /* Prevent text from being too wide */
    .container {
        max-width: 100%;
    }
}

