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

:root {
    /* Light theme variables */
    --bg-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-secondary: white;
    --text-primary: #333;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --border-hover: #cbd5e0;
    --shadow: 0 10px 30px rgba(0,0,0,0.1);
    --input-bg: white;
    --input-border: #e2e8f0;
    --input-focus: #667eea;
    --card-bg: #f7fafc;
    --accent-color: #667eea;
    --accent-hover: #5a67d8;
    --summary-bg: #667eea;
    --summary-text: white;
}

[data-theme="dark"] {
    /* Dark theme variables */
    --bg-primary: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    --bg-secondary: #2d3748;
    --text-primary: #f7fafc;
    --text-secondary: #e2e8f0;
    --text-muted: #a0aec0;
    --border-color: #4a5568;
    --border-hover: #718096;
    --shadow: 0 10px 30px rgba(0,0,0,0.3);
    --input-bg: #4a5568;
    --input-border: #4a5568;
    --input-focus: #667eea;
    --card-bg: #4a5568;
    --accent-color: #667eea;
    --accent-hover: #5a67d8;
    --summary-bg: #667eea;
    --summary-text: white;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

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

header {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

nav {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    display: inline-block;
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.1);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    font-size: 1.2rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.input-section, .results-section {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.config-group {
    margin-bottom: 2rem;
}

.config-group h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.beta-flag {
    background: #f6ad55;
    color: #744210;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.input-row {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.input-row label {
    min-width: 140px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.input-row input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--input-border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease, background 0.3s ease;
    background: var(--input-bg);
    color: var(--text-primary);
}

.input-row input:focus {
    outline: none;
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.weight-info {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.25rem;
    margin-left: 140px;
    transition: color 0.3s ease;
}

.optional-info {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.25rem;
    margin-left: 140px;
    transition: color 0.3s ease;
}

.overhead-info {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.25rem;
    margin-left: 140px;
    transition: color 0.3s ease;
}

.overhead-warning {
    font-size: 0.8rem;
    color: #e53e3e;
    font-weight: 500;
    margin-top: 0.25rem;
    margin-left: 140px;
    transition: color 0.3s ease;
}

.input-row input.warning {
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

/* Tooltip styles */
.tooltip-container {
    position: relative;
    display: inline-block;
}

.tooltip-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 16px;
    font-size: 10px;
    font-weight: bold;
    margin-left: 8px;
    cursor: help;
    transition: background-color 0.2s ease;
}

.tooltip-icon:hover {
    background: var(--accent-hover);
}

.tooltip {
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 12px;
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1.4;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    max-width: 300px;
    white-space: normal;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--bg-secondary);
}

.tooltip-container:hover .tooltip {
    opacity: 1;
    visibility: visible;
}

.topic-input {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s ease, background 0.3s ease;
}

.topic-input:hover {
    border-color: var(--border-hover);
}

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

.topic-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.remove-topic {
    background: #fed7d7;
    color: #c53030;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.remove-topic:hover {
    background: #feb2b2;
    transform: scale(1.1);
}

.add-topic-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.add-topic-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.results-section h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.no-results {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 2rem;
    transition: color 0.3s ease;
}

.topic-result {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.topic-result h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    transition: border-color 0.3s ease;
}

.result-item:last-child {
    border-bottom: none;
}

.result-label {
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.result-value {
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background: var(--card-bg);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background 0.3s ease, color 0.3s ease;
}

.result-value.recommended {
    background: var(--accent-color);
    color: white;
    font-weight: 700;
    border: 2px solid var(--accent-hover);
}

.summary-section {
    background: var(--summary-bg);
    color: var(--summary-text);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.summary-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

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

.summary-item:last-child {
    margin-bottom: 0;
}

footer {
    text-align: center;
    color: white;
    opacity: 0.8;
    font-size: 0.9rem;
}

.footer-link {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.footer-link:hover {
    opacity: 1;
    text-decoration: underline;
}

@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .container {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .input-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .input-row label {
        min-width: auto;
    }
    
    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
} 