/**
 * Superior Theme Framework - Professional Website Theme System
 * Fixes broken themes and provides enterprise-grade design consistency
 * Competitive with Elementor Pro, Divi, and other premium themes
 */

/* ===== CORE DESIGN SYSTEM ===== */
:root {
    /* Professional Color Palette */
    --theme-primary: #0d9488;
    --theme-primary-light: #14b8a6;
    --theme-primary-dark: #0f766e;
    --theme-primary-darker: #134e4a;
    
    --theme-secondary: #3b82f6;
    --theme-secondary-light: #60a5fa;
    --theme-secondary-dark: #2563eb;
    
    --theme-accent: #f59e0b;
    --theme-accent-light: #fbbf24;
    --theme-accent-dark: #d97706;
    
    --theme-success: #10b981;
    --theme-warning: #f59e0b;
    --theme-error: #ef4444;
    --theme-info: #06b6d4;
    
    /* Neutral Colors */
    --theme-gray-50: #f9fafb;
    --theme-gray-100: #f3f4f6;
    --theme-gray-200: #e5e7eb;
    --theme-gray-300: #d1d5db;
    --theme-gray-400: #9ca3af;
    --theme-gray-500: #6b7280;
    --theme-gray-600: #4b5563;
    --theme-gray-700: #374151;
    --theme-gray-800: #1f2937;
    --theme-gray-900: #111827;
    
    /* Typography Scale */
    --theme-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --theme-font-family-heading: 'Inter', var(--theme-font-family);
    
    --theme-text-xs: 0.75rem;     /* 12px */
    --theme-text-sm: 0.875rem;    /* 14px */
    --theme-text-base: 1rem;      /* 16px */
    --theme-text-lg: 1.125rem;    /* 18px */
    --theme-text-xl: 1.25rem;     /* 20px */
    --theme-text-2xl: 1.5rem;     /* 24px */
    --theme-text-3xl: 1.875rem;   /* 30px */
    --theme-text-4xl: 2.25rem;    /* 36px */
    --theme-text-5xl: 3rem;      /* 48px */
    --theme-text-6xl: 3.75rem;   /* 60px */
    --theme-text-7xl: 4.5rem;    /* 72px */
    --theme-text-8xl: 6rem;      /* 96px */
    
    /* Spacing Scale */
    --theme-space-1: 0.25rem;     /* 4px */
    --theme-space-2: 0.5rem;      /* 8px */
    --theme-space-3: 0.75rem;     /* 12px */
    --theme-space-4: 1rem;        /* 16px */
    --theme-space-5: 1.25rem;     /* 20px */
    --theme-space-6: 1.5rem;      /* 24px */
    --theme-space-8: 2rem;        /* 32px */
    --theme-space-10: 2.5rem;     /* 40px */
    --theme-space-12: 3rem;       /* 48px */
    --theme-space-16: 4rem;       /* 64px */
    --theme-space-20: 5rem;       /* 80px */
    --theme-space-24: 6rem;       /* 96px */
    --theme-space-32: 8rem;       /* 128px */
    
    /* Border Radius */
    --theme-radius-sm: 0.25rem;
    --theme-radius: 0.5rem;
    --theme-radius-md: 0.75rem;
    --theme-radius-lg: 1rem;
    --theme-radius-xl: 1.5rem;
    --theme-radius-2xl: 2rem;
    --theme-radius-full: 9999px;
    
    /* Shadows */
    --theme-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --theme-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --theme-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --theme-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --theme-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --theme-shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    
    /* Gradients */
    --theme-gradient-primary: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-primary-dark) 100%);
    --theme-gradient-secondary: linear-gradient(135deg, var(--theme-secondary) 0%, var(--theme-secondary-dark) 100%);
    --theme-gradient-accent: linear-gradient(135deg, var(--theme-accent) 0%, var(--theme-accent-dark) 100%);
    --theme-gradient-hero: linear-gradient(135deg, var(--theme-primary-darker) 0%, var(--theme-primary) 50%, var(--theme-primary-dark) 100%);
    
    /* Transitions */
    --theme-transition-fast: 0.15s ease;
    --theme-transition: 0.3s ease;
    --theme-transition-slow: 0.5s ease;
    
    /* Z-Index Scale */
    --theme-z-dropdown: 1000;
    --theme-z-sticky: 1020;
    --theme-z-fixed: 1030;
    --theme-z-modal-backdrop: 1040;
    --theme-z-modal: 1050;
    --theme-z-popover: 1060;
    --theme-z-tooltip: 1070;
    --theme-z-toast: 1080;
}

/* ===== RESET & BASE ===== */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--theme-font-family);
    font-size: var(--theme-text-base);
    line-height: 1.6;
    color: var(--theme-gray-800);
    background-color: var(--theme-gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== TYPOGRAPHY SYSTEM ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--theme-font-family-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--theme-gray-900);
    margin-top: 0;
    margin-bottom: var(--theme-space-4);
}

h1 { font-size: var(--theme-text-5xl); font-weight: 800; }
h2 { font-size: var(--theme-text-4xl); font-weight: 800; }
h3 { font-size: var(--theme-text-3xl); font-weight: 700; }
h4 { font-size: var(--theme-text-2xl); font-weight: 700; }
h5 { font-size: var(--theme-text-xl); font-weight: 600; }
h6 { font-size: var(--theme-text-lg); font-weight: 600; }

p {
    margin-top: 0;
    margin-bottom: var(--theme-space-4);
    color: var(--theme-gray-600);
}

/* Responsive typography */
@media (max-width: 768px) {
    h1 { font-size: var(--theme-text-4xl); }
    h2 { font-size: var(--theme-text-3xl); }
    h3 { font-size: var(--theme-text-2xl); }
    h4 { font-size: var(--theme-text-xl); }
    h5 { font-size: var(--theme-text-lg); }
    h6 { font-size: var(--theme-text-base); }
}

/* ===== LAYOUT COMPONENTS ===== */
.theme-container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--theme-space-4);
    padding-right: var(--theme-space-4);
}

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

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

.theme-section {
    padding-top: var(--theme-space-20);
    padding-bottom: var(--theme-space-20);
}

@media (min-width: 768px) {
    .theme-section { padding-top: var(--theme-space-24); padding-bottom: var(--theme-space-24); }
}

.theme-grid {
    display: grid;
    gap: var(--theme-space-6);
}

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

@media (max-width: 768px) {
    .theme-grid-cols-2,
    .theme-grid-cols-3,
    .theme-grid-cols-4 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .theme-grid-cols-3,
    .theme-grid-cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ===== BUTTON SYSTEM ===== */
.theme-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--theme-space-2);
    padding: var(--theme-space-4) var(--theme-space-6);
    font-family: var(--theme-font-family);
    font-size: var(--theme-text-base);
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: var(--theme-radius-lg);
    cursor: pointer;
    transition: all var(--theme-transition);
    position: relative;
    overflow: hidden;
}

.theme-btn:focus {
    outline: 2px solid var(--theme-primary);
    outline-offset: 2px;
}

.theme-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Button Variants */
.theme-btn-primary {
    background: var(--theme-gradient-primary);
    color: white;
    box-shadow: var(--theme-shadow-md);
}

.theme-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--theme-shadow-lg);
}

.theme-btn-secondary {
    background: white;
    color: var(--theme-primary);
    border-color: var(--theme-primary);
    box-shadow: var(--theme-shadow);
}

.theme-btn-secondary:hover:not(:disabled) {
    background: var(--theme-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--theme-shadow-lg);
}

.theme-btn-outline {
    background: transparent;
    color: var(--theme-primary);
    border-color: var(--theme-primary);
}

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

.theme-btn-ghost {
    background: transparent;
    color: var(--theme-gray-600);
}

.theme-btn-ghost:hover:not(:disabled) {
    background: var(--theme-gray-100);
    color: var(--theme-gray-900);
}

/* Button Sizes */
.theme-btn-sm {
    padding: var(--theme-space-2) var(--theme-space-4);
    font-size: var(--theme-text-sm);
}

.theme-btn-lg {
    padding: var(--theme-space-5) var(--theme-space-8);
    font-size: var(--theme-text-lg);
}

/* ===== CARD SYSTEM ===== */
.theme-card {
    background: white;
    border-radius: var(--theme-radius-xl);
    box-shadow: var(--theme-shadow);
    border: 1px solid var(--theme-gray-200);
    overflow: hidden;
    transition: all var(--theme-transition);
}

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

.theme-card-header {
    padding: var(--theme-space-6);
    border-bottom: 1px solid var(--theme-gray-200);
}

.theme-card-body {
    padding: var(--theme-space-6);
}

.theme-card-footer {
    padding: var(--theme-space-6);
    border-top: 1px solid var(--theme-gray-200);
    background: var(--theme-gray-50);
}

/* ===== SERVICE CARD COMPONENT ===== */
.theme-service-card {
    background: white;
    border-radius: var(--theme-radius-xl);
    padding: var(--theme-space-8);
    box-shadow: var(--theme-shadow);
    border: 1px solid var(--theme-gray-200);
    text-align: center;
    transition: all var(--theme-transition);
    position: relative;
    overflow: hidden;
}

.theme-service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--theme-gradient-primary);
    transform: scaleX(0);
    transition: transform var(--theme-transition);
}

.theme-service-card:hover::before {
    transform: scaleX(1);
}

.theme-service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--theme-shadow-2xl);
}

.theme-service-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--theme-space-4);
    background: var(--theme-gradient-primary);
    border-radius: var(--theme-radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    transition: all var(--theme-transition);
}

.theme-service-card:hover .theme-service-icon {
    transform: scale(1.1);
    box-shadow: var(--theme-shadow-lg);
}

.theme-service-title {
    font-size: var(--theme-text-xl);
    font-weight: 700;
    color: var(--theme-gray-900);
    margin-bottom: var(--theme-space-3);
}

.theme-service-description {
    color: var(--theme-gray-600);
    margin-bottom: var(--theme-space-6);
    line-height: 1.6;
}

.theme-service-features {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--theme-space-6);
}

.theme-service-feature {
    display: flex;
    align-items: center;
    gap: var(--theme-space-2);
    padding: var(--theme-space-2) 0;
    color: var(--theme-gray-600);
    font-size: var(--theme-text-sm);
}

.theme-service-feature::before {
    content: '✓';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--theme-success);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}

/* ===== HERO SECTION ===== */
.theme-hero {
    background: var(--theme-gradient-hero);
    color: white;
    padding: var(--theme-space-24) 0;
    position: relative;
    overflow: hidden;
}

.theme-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 50%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    z-index: 1;
}

.theme-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.theme-hero-title {
    font-size: var(--theme-text-6xl);
    font-weight: 900;
    margin-bottom: var(--theme-space-6);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .theme-hero-title { font-size: var(--theme-text-4xl); }
}

.theme-hero-subtitle {
    font-size: var(--theme-text-xl);
    margin-bottom: var(--theme-space-8);
    opacity: 0.9;
    line-height: 1.6;
}

.theme-hero-actions {
    display: flex;
    gap: var(--theme-space-4);
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== PRICING COMPONENT ===== */
.theme-pricing-card {
    background: white;
    border-radius: var(--theme-radius-2xl);
    padding: var(--theme-space-8);
    box-shadow: var(--theme-shadow-lg);
    border: 2px solid var(--theme-gray-200);
    text-align: center;
    transition: all var(--theme-transition);
    position: relative;
}

.theme-pricing-card.featured {
    border-color: var(--theme-primary);
    transform: scale(1.05);
    box-shadow: var(--theme-shadow-2xl);
}

.theme-pricing-card.featured::before {
    content: 'Meest Populair';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--theme-gradient-accent);
    color: white;
    padding: var(--theme-space-2) var(--theme-space-4);
    border-radius: var(--theme-radius-full);
    font-size: var(--theme-text-sm);
    font-weight: 600;
}

.theme-pricing-price {
    font-size: var(--theme-text-5xl);
    font-weight: 900;
    color: var(--theme-primary);
    margin-bottom: var(--theme-space-2);
}

.theme-pricing-period {
    color: var(--theme-gray-500);
    font-size: var(--theme-text-base);
}

.theme-pricing-features {
    list-style: none;
    padding: 0;
    margin: var(--theme-space-6) 0;
}

.theme-pricing-feature {
    padding: var(--theme-space-3) 0;
    border-bottom: 1px solid var(--theme-gray-200);
    color: var(--theme-gray-600);
}

.theme-pricing-feature:last-child {
    border-bottom: none;
}

/* ===== FORM COMPONENTS ===== */
.theme-form-group {
    margin-bottom: var(--theme-space-6);
}

.theme-form-label {
    display: block;
    font-weight: 600;
    color: var(--theme-gray-700);
    margin-bottom: var(--theme-space-2);
}

.theme-form-input,
.theme-form-select,
.theme-form-textarea {
    width: 100%;
    padding: var(--theme-space-3) var(--theme-space-4);
    border: 2px solid var(--theme-gray-300);
    border-radius: var(--theme-radius-lg);
    font-family: var(--theme-font-family);
    font-size: var(--theme-text-base);
    transition: all var(--theme-transition);
    background: white;
}

.theme-form-input:focus,
.theme-form-select:focus,
.theme-form-textarea:focus {
    outline: none;
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.theme-form-textarea {
    resize: vertical;
    min-height: 120px;
}

/* ===== UTILITY CLASSES ===== */
.theme-text-center { text-align: center; }
.theme-text-left { text-align: left; }
.theme-text-right { text-align: right; }

.theme-font-bold { font-weight: 700; }
.theme-font-semibold { font-weight: 600; }
.theme-font-medium { font-weight: 500; }

.theme-text-primary { color: var(--theme-primary); }
.theme-text-secondary { color: var(--theme-secondary); }
.theme-text-accent { color: var(--theme-accent); }
.theme-text-success { color: var(--theme-success); }
.theme-text-warning { color: var(--theme-warning); }
.theme-text-error { color: var(--theme-error); }
.theme-text-gray { color: var(--theme-gray-600); }

.theme-bg-primary { background: var(--theme-primary); }
.theme-bg-secondary { background: var(--theme-secondary); }
.theme-bg-accent { background: var(--theme-accent); }
.theme-bg-success { background: var(--theme-success); }
.theme-bg-warning { background: var(--theme-warning); }
.theme-bg-error { background: var(--theme-error); }
.theme-bg-gray { background: var(--theme-gray-100); }

.theme-shadow-sm { box-shadow: var(--theme-shadow-sm); }
.theme-shadow { box-shadow: var(--theme-shadow); }
.theme-shadow-md { box-shadow: var(--theme-shadow-md); }
.theme-shadow-lg { box-shadow: var(--theme-shadow-lg); }
.theme-shadow-xl { box-shadow: var(--theme-shadow-xl); }
.theme-shadow-2xl { box-shadow: var(--theme-shadow-2xl); }

.theme-rounded { border-radius: var(--theme-radius); }
.theme-rounded-md { border-radius: var(--theme-radius-md); }
.theme-rounded-lg { border-radius: var(--theme-radius-lg); }
.theme-rounded-xl { border-radius: var(--theme-radius-xl); }
.theme-rounded-2xl { border-radius: var(--theme-radius-2xl); }
.theme-rounded-full { border-radius: var(--theme-radius-full); }

/* ===== ANIMATIONS ===== */
@keyframes theme-fade-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes theme-slide-in-left {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes theme-slide-in-right {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes theme-scale-in {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes theme-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.theme-animate-fade-in { animation: theme-fade-in 0.6s ease-out; }
.theme-animate-slide-in-left { animation: theme-slide-in-left 0.6s ease-out; }
.theme-animate-slide-in-right { animation: theme-slide-in-right 0.6s ease-out; }
.theme-animate-scale-in { animation: theme-scale-in 0.4s ease-out; }
.theme-animate-pulse { animation: theme-pulse 2s infinite; }

/* ===== RESPONSIVE HELPERS ===== */
.theme-hidden { display: none; }
.theme-block { display: block; }
.theme-flex { display: flex; }
.theme-grid { display: grid; }

@media (max-width: 640px) {
    .theme-sm-hidden { display: none; }
    .theme-sm-block { display: block; }
    .theme-sm-flex { display: flex; }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .theme-md-hidden { display: none; }
    .theme-md-block { display: block; }
    .theme-md-flex { display: flex; }
}

@media (min-width: 1025px) {
    .theme-lg-hidden { display: none; }
    .theme-lg-block { display: block; }
    .theme-lg-flex { display: flex; }
}

/* ===== ACCESSIBILITY ===== */
@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;
    }
}

.theme-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;
}

/* ===== PRINT STYLES ===== */
@media print {
    .theme-print-hidden { display: none !important; }
    .theme-print-block { display: block !important; }
    
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    .theme-hero,
    .theme-section {
        page-break-inside: avoid;
    }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --theme-gray-50: #111827;
        --theme-gray-100: #1f2937;
        --theme-gray-200: #374151;
        --theme-gray-300: #4b5563;
        --theme-gray-400: #6b7280;
        --theme-gray-500: #9ca3af;
        --theme-gray-600: #d1d5db;
        --theme-gray-700: #e5e7eb;
        --theme-gray-800: #f3f4f6;
        --theme-gray-900: #f9fafb;
    }
    
    body {
        background-color: var(--theme-gray-50);
        color: var(--theme-gray-800);
    }
    
    .theme-card,
    .theme-service-card,
    .theme-pricing-card {
        background: var(--theme-gray-100);
        border-color: var(--theme-gray-200);
    }
    
    .theme-form-input,
    .theme-form-select,
    .theme-form-textarea {
        background: var(--theme-gray-100);
        border-color: var(--theme-gray-300);
        color: var(--theme-gray-800);
    }
}
