
/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1e3a8a;
    --secondary-color: #3b82f6;
    --accent-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-color: #1f2937;
    --light-color: #f8fafc;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.nav-brand i {
    font-size: 2rem;
    color: var(--accent-color);
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

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

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: var(--transition);
}

.nav-link:hover::after {
    width: 100%;
}

.region-selector select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: white;
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.region-selector select:hover {
    border-color: var(--primary-color);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.9) 0%, rgba(59, 130, 246, 0.8) 100%);
    color: white;
    padding: 8rem 2rem 4rem;
    text-align: center;
    margin-top: 70px;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 3rem;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 4rem;
    margin-top: 3rem;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent-color);
}

.stat-label {
    font-size: 1rem;
    opacity: 0.8;
}

/* Main Sections */
main {
    background: var(--light-color);
}

section {
    padding: 4rem 0;
}

section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--primary-color);
}

/* Framework Explorer */
.domain-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.domain-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 2rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.domain-btn:hover,
.domain-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.frameworks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.framework-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

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

.framework-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.framework-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.framework-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.framework-tag {
    background: var(--accent-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.framework-actions {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

.btn:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

/* Simulator Section */
.simulator-interface {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.simulator-controls {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.simulator-controls label {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: block;
}

.simulator-controls select,
.simulator-controls input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: var(--transition);
}

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

.parameters-panel {
    background: var(--light-color);
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.parameter-control {
    margin-bottom: 1.5rem;
}

.parameter-control:last-child {
    margin-bottom: 0;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.slider {
    flex: 1;
    -webkit-appearance: none;
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
}

.slider-value {
    font-weight: 600;
    color: var(--primary-color);
    min-width: 40px;
    text-align: center;
}

.simulate-btn {
    background: var(--accent-color);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.simulate-btn:hover {
    background: #059669;
    transform: translateY(-2px);
}

.visualization-area {
    display: flex;
    flex-direction: column;
}

.viz-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.viz-tab {
    padding: 1rem 2rem;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
}

.viz-tab.active,
.viz-tab:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.viz-content {
    flex: 1;
    position: relative;
    height: 450px;
    overflow: hidden;
}

#chartCanvas {
    width: 100% !important;
    height: 400px !important;
    max-width: 100%;
    position: relative;
}

.network-container,
.matrix-container {
    width: 100%;
    height: 450px;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: white;
    display: none;
    overflow: visible;
    position: relative;
    padding: 10px;
}

.network-container.active,
.matrix-container.active {
    display: block;
}

.matrix-container svg {
    width: 100%;
    height: 100%;
    background: white;
}

.matrix-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Analytics Section */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.analytics-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.analytics-card h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.analytics-card canvas {
    width: 100% !important;
    height: 250px !important;
    max-width: 100%;
    position: relative;
}

.metrics-display {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.metric-item {
    text-align: center;
    padding: 1rem;
    background: var(--light-color);
    border-radius: 0.5rem;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
}

.metric-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.recommendations {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.recommendation-item {
    padding: 1rem;
    background: var(--light-color);
    border-radius: 0.5rem;
    border-left: 4px solid var(--accent-color);
}

.recommendation-item h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.recommendation-item p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.priority {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.priority-high {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.priority-medium {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.priority-low {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-color);
}

/* Comparison Section */
.comparison-interface {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.comparison-selectors {
    display: flex;
    gap: 2rem;
    align-items: end;
    margin-bottom: 3rem;
}

.selector-group {
    flex: 1;
}

.selector-group label {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: block;
}

.comparison-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
}

.compare-btn {
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.compare-btn:hover {
    background: #1e40af;
    transform: translateY(-1px);
}

.comparison-results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 3rem;
}

.comparison-chart canvas {
    width: 100% !important;
    height: 300px !important;
    max-width: 100%;
    position: relative;
}

.comparison-table {
    overflow-x: auto;
}

.comparison-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.comparison-table th,
.comparison-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.comparison-table th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.comparison-table tr:hover {
    background: var(--light-color);
}

/* Footer */
.footer {
    background: var(--dark-color);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 2rem;
    }
    
    .simulator-interface {
        grid-template-columns: 1fr;
    }
    
    .comparison-selectors {
        flex-direction: column;
        align-items: stretch;
    }
    
    .comparison-results {
        grid-template-columns: 1fr;
    }
    
    .nav-menu {
        display: none;
    }
    
    .container {
        padding: 0 1rem;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Utility Classes */
.hidden {
    display: none !important;
}

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

.mt-2 {
    margin-top: 1rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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