:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --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);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-primary);
    background: var(--bg-secondary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

/* Navbar */
.navbar {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

.language-selector {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 0;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 3rem 0;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto 1.5rem;
}

.url-input {
    flex: 1;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.2s;
}

.url-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.analyze-btn {
    padding: 0.875rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

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

.example-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.example-link {
    padding: 0.375rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.example-link:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Loading Section */
.loading-section {
    text-align: center;
    padding: 4rem 0;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.loading-progress {
    max-width: 400px;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    margin: 0 auto 1rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #7c3aed);
    border-radius: 4px;
    transition: width 0.3s ease;
}

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

/* Results Section */
.results-section {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.results-header h2 {
    font-size: 1.75rem;
    font-weight: 600;
}

.export-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

/* Score Overview */
.score-overview {
    margin-bottom: 3rem;
}

.score-card {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
}

.score-circle {
    position: relative;
    width: 120px;
    height: 120px;
}

.score-circle svg {
    transform: rotate(-90deg);
}

.score-progress {
    transition: stroke-dashoffset 1s ease;
}

.score-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.score-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.score-details h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.score-description {
    color: var(--text-secondary);
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.metric-card {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 2px solid transparent;
    transition: all 0.3s;
}

.metric-card.good {
    border-color: var(--success-color);
}

.metric-card.needs-improvement {
    border-color: var(--warning-color);
}

.metric-card.poor {
    border-color: var(--danger-color);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.metric-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.metric-badge {
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.metric-badge.good {
    background: #d1fae5;
    color: #065f46;
}

.metric-badge.needs-improvement {
    background: #fed7aa;
    color: #92400e;
}

.metric-badge.poor {
    background: #fee2e2;
    color: #991b1b;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.metric-label {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

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

/* Resource Breakdown */
.resource-breakdown {
    margin-bottom: 3rem;
}

.resource-breakdown h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

.resource-list {
    space-y: 1rem;
}

.resource-item {
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.resource-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.resource-type {
    font-weight: 500;
}

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

.resource-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.resource-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #7c3aed);
    border-radius: 4px;
    transition: width 0.5s ease;
}

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

/* Recommendations */
.recommendations h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

.recommendation-item {
    padding: 1.25rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--border-color);
    margin-bottom: 1rem;
    transition: all 0.2s;
}

.recommendation-item.high {
    border-left-color: var(--danger-color);
}

.recommendation-item.medium {
    border-left-color: var(--warning-color);
}

.recommendation-item.low {
    border-left-color: var(--success-color);
}

.recommendation-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.recommendation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.recommendation-header h4 {
    font-size: 1rem;
    font-weight: 600;
}

.impact-badge {
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.impact-badge.high {
    background: #fee2e2;
    color: #991b1b;
}

.impact-badge.medium {
    background: #fed7aa;
    color: #92400e;
}

.impact-badge.low {
    background: #d1fae5;
    color: #065f46;
}

.recommendation-description {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-size: 0.9375rem;
}

.recommendation-savings {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--success-color);
    font-size: 0.875rem;
    font-weight: 500;
}

.recommendation-savings svg {
    width: 16px;
    height: 16px;
}

/* Error Section */
.error-section {
    text-align: center;
    padding: 4rem 0;
}

.error-content {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 3rem;
    max-width: 500px;
    margin: 0 auto;
}

.error-content svg {
    color: var(--danger-color);
    margin-bottom: 1rem;
}

.error-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.error-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.retry-btn {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

/* Footer */
.footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    text-align: center;
    margin-top: auto;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .analyze-btn {
        width: 100%;
        justify-content: center;
    }
    
    .score-card {
        flex-direction: column;
        text-align: center;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .example-links {
        flex-wrap: wrap;
    }
}