/**
 * Minimalist Blue Theme - Clinical Trials Intelligence Hub
 * Beautiful, clean, modern design with blue color scheme
 */

/* ===== CSS RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    line-height: 1.6;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #fafbfc;
    color: #1a202c;
    font-weight: 400;
    overflow-x: hidden;
}

/* ===== COLOR SYSTEM ===== */
:root {
    /* Primary Blue Palette */
    --blue-50: #eff6ff;
    --blue-100: #dbeafe;
    --blue-200: #bfdbfe;
    --blue-300: #93c5fd;
    --blue-400: #60a5fa;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
    --blue-800: #1e40af;
    --blue-900: #1e3a8a;
    
    /* Neutrals */
    --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;
    
    /* Status Colors */
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --error: #ef4444;
    --error-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;
    
    /* Extended Color Palette */
    --green-50: #f0fdf4;
    --green-100: #dcfce7;
    --green-200: #bbf7d0;
    --green-800: #166534;
    
    --orange-50: #fff7ed;
    --orange-100: #ffedd5;
    --orange-200: #fed7aa;
    --orange-800: #9a3412;
    
    --red-50: #fef2f2;
    --red-100: #fee2e2;
    --red-200: #fecaca;
    --red-800: #991b1b;
    
    --yellow-50: #fefce8;
    --yellow-100: #fef3c7;
    --yellow-200: #fde68a;
    --yellow-800: #92400e;
    
    --purple-50: #faf5ff;
    --purple-100: #f3e8ff;
    --purple-200: #e9d5ff;
    --purple-800: #6b21a8;
    
    --indigo-50: #eef2ff;
    --indigo-100: #e0e7ff;
    --indigo-200: #c7d2fe;
    --indigo-800: #3730a3;
    
    --teal-50: #f0fdfa;
    --teal-100: #ccfbf1;
    --teal-200: #99f6e4;
    --teal-800: #115e59;
    
    /* Semantic Colors */
    --primary: var(--blue-600);
    --primary-dark: var(--blue-700);
    --primary-light: var(--blue-500);
    --background: #fafbfc;
    --surface: #ffffff;
    --border: var(--gray-200);
    --text: var(--gray-900);
    --text-muted: var(--gray-600);
    --text-light: var(--gray-500);
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    
    /* Typography */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ===== LAYOUT ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.content-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    padding: var(--space-8) 0;
}

/* ===== HEADER ===== */
.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-6);
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
    color: var(--text);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--blue-600), var(--blue-700));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--text-xl);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.logo-subtitle {
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-weight: 500;
}

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

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: var(--text-sm);
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--primary);
    background: var(--blue-50);
}

.nav-link.active {
    color: var(--primary);
    background: var(--blue-100);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: var(--text-lg);
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.mobile-menu-toggle:hover {
    color: var(--primary);
    background: var(--blue-50);
}

/* ===== HERO SECTION ===== */
.hero {
    background: linear-gradient(135deg, var(--blue-50) 0%, var(--blue-100) 100%);
    padding: var(--space-20) 0 var(--space-16);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23e0f2fe' fill-opacity='0.4'%3E%3Ccircle cx='7' cy='7' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: var(--text-5xl);
    font-weight: 800;
    color: var(--text);
    margin-bottom: var(--space-6);
    line-height: 1.1;
}

.hero-subtitle {
    font-size: var(--text-xl);
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto var(--space-8);
    line-height: 1.6;
}

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

/* ===== MODERN & MINIMAL HERO VARIANTS ===== */
.hero-modern {
    background: linear-gradient(135deg, var(--blue-50) 0%, var(--blue-100) 100%);
    border-bottom: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.hero-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="hero-grid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="rgba(59,130,246,0.08)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23hero-grid)"/></svg>');
    opacity: 0.4;
}

.hero-modern .hero-content {
    position: relative;
    z-index: 2;
    padding: 4rem 0 3rem;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(59, 130, 246, 0.1);
    color: var(--blue-700);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(59, 130, 246, 0.2);
    backdrop-filter: blur(10px);
}

.hero-badge i {
    color: var(--blue-600);
}

.hero-modern .hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.gradient-text {
    background: linear-gradient(135deg, var(--blue-600), var(--blue-800));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-modern .hero-subtitle {
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-metrics {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.metric-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.metric-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--blue-600);
    line-height: 1;
}

.metric-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 0.25rem;
}

.metric-separator {
    color: var(--border);
    font-size: 1.5rem;
    font-weight: 300;
}

/* Minimal Hero Styles */
.hero-minimal {
    background: var(--gray-50);
    border-bottom: 1px solid var(--border);
    padding: 2rem 0 2rem;
}

.hero-minimal .hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.75rem;
    text-align: center;
}

.hero-minimal .hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Modern Hero Responsive */
@media (max-width: 768px) {
    .hero-modern .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-modern .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-metrics {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .metric-separator {
        display: none;
    }
    
    .hero-minimal .hero-title {
        font-size: 2rem;
    }
    
    .hero-minimal .hero-subtitle {
        font-size: 1rem;
    }
}

/* ===== CARDS & TILES ===== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--blue-200);
}

.card-header {
    margin-bottom: var(--space-6);
}

.card-title {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text);
    margin-bottom: var(--space-2);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.card-subtitle {
    font-size: var(--text-sm);
    color: var(--text-muted);
    line-height: 1.5;
}

/* Stat Cards */
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
    z-index: 1;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--blue-500), var(--blue-600));
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.stat-card:hover,
.stat-card:focus-within {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--blue-200);
    z-index: 100;
}

.stat-number {
    font-size: var(--text-4xl);
    font-weight: 800;
    color: var(--primary);
    margin-bottom: var(--space-2);
    line-height: 1;
}

.stat-label {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--space-1);
}

.stat-description {
    font-size: var(--text-sm);
    color: var(--text-muted);
    line-height: 1.4;
}

/* ===== GRID SYSTEM ===== */
.grid {
    display: grid;
    gap: var(--space-6);
}

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

.grid-auto {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Responsive grid modifiers */
@media (max-width: 1200px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    .grid-6 {
        grid-template-columns: repeat(3, 1fr);
    }
    .grid-auto {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 900px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    .grid-6 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .grid-2,
    .grid-3,
    .grid-4,
    .grid-6 {
        grid-template-columns: 1fr;
    }
    .grid-auto {
        grid-template-columns: 1fr;
    }
}

/* ===== SPACING UTILITIES ===== */
.space-y-4 > * + * { margin-top: var(--space-4); }
.space-y-6 > * + * { margin-top: var(--space-6); }
.space-y-8 > * + * { margin-top: var(--space-8); }

.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); }
.mt-16 { margin-top: var(--space-16); }
.-mt-16 { margin-top: -4rem; }

/* Responsive margin adjustments */
@media (max-width: 768px) {
    .-mt-16 { margin-top: var(--space-4); }
}

.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.mx-auto { margin-left: auto; margin-right: auto; }

.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }

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

/* Flexbox utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }

/* Width utilities */
.w-full { width: 100%; }
.w-auto { width: auto; }

/* Position utilities */
.relative { position: relative; }
.absolute { position: absolute; }
.z-10 { z-index: 10; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.5;
}

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

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

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

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

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

/* ===== FORMS ===== */
.form-group {
    margin-bottom: var(--space-4);
}

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

.form-input,
.form-select {
    width: 100%;
    padding: var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    color: var(--text);
    background: var(--surface);
    transition: all 0.2s ease;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: 600;
    border-radius: var(--radius-sm);
    line-height: 1;
}

.badge-primary {
    background: var(--blue-100);
    color: var(--blue-800);
}

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

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

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

/* ===== COMPETITIVE ANALYTICS ===== */
.competitive-section {
    margin-top: var(--space-12);
}

.competitive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-6);
    margin-top: var(--space-8);
}

.competitive-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    transition: all 0.3s ease;
}

.competitive-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--blue-200);
}

.competitive-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.competitive-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--blue-100), var(--blue-200));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--blue-700);
}

.competitive-title {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}

.metric-item {
    text-align: center;
    padding: var(--space-4);
    background: var(--gray-50);
    border-radius: var(--radius);
}

.metric-value {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--primary);
    margin-bottom: var(--space-1);
}

.metric-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===== LOADING STATES ===== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-8);
    color: var(--text-muted);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===== FOOTER ===== */
.footer {
    background: var(--gray-900);
    color: var(--gray-300);
    padding: var(--space-16) 0 var(--space-8);
    margin-top: var(--space-20);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-8);
    margin-bottom: var(--space-12);
}

.footer-section h4 {
    color: white;
    font-weight: 700;
    margin-bottom: var(--space-4);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: var(--space-2);
}

.footer-links a {
    color: var(--gray-400);
    text-decoration: none;
    font-size: var(--text-sm);
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--blue-400);
}

.footer-bottom {
    border-top: 1px solid var(--gray-800);
    padding-top: var(--space-8);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.footer-copyright {
    font-size: var(--text-sm);
    color: var(--gray-500);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .container {
        padding: 0 var(--space-4);
    }
    
    .hero-title {
        font-size: var(--text-4xl);
    }
    
    .hero-subtitle {
        font-size: var(--text-lg);
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: var(--space-3) var(--space-4);
    }
    
    .nav {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .hero {
        padding: var(--space-16) 0 var(--space-12);
    }
    
    .hero-title {
        font-size: var(--text-3xl);
    }
    
    .hero-subtitle {
        font-size: var(--text-base);
    }
    
    /* Grid responsive rules moved to dedicated section above */
    
    .metric-grid {
        grid-template-columns: 1fr;
    }
    
    .competitive-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--space-3);
    }
    
    .card,
    .stat-card,
    .competitive-card {
        padding: var(--space-4);
    }
    
    .hero {
        padding: var(--space-12) 0 var(--space-8);
    }
    
    .hero-title {
        font-size: var(--text-2xl);
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Make sure inline styles don't override responsive behavior */
    [style*="margin-top: -"] {
        margin-top: var(--space-2) !important;
    }
    
    [style*="margin-top: 3rem"] {
        margin-top: var(--space-6) !important;
    }
    
    /* Fix card spacing on mobile */
    .grid > * {
        margin-bottom: var(--space-4);
    }
    
    .grid:last-child {
        margin-bottom: 0;
    }
    
    .hero-actions {
        flex-direction: column;
    }
}