:root {
    /* Brutalist Palette */
    --primary-color: #ccff00;
    /* Neon Lime */
    --primary-hover: #b3e600;
    --secondary-color: #ff00ff;
    /* Neon Magenta */
    --background: #ffffff;
    --surface: #ffffff;
    --text-primary: #000000;
    --text-secondary: #444444;
    --text-secondary: #444444;
    --border-color: #000000;
    --border-color: #000000;
    --text-on-primary: #000000;
    --accent-text: #000000;

    /* Layout & Spacing */
    --radius-sm: 0px;
    --radius-md: 0px;
    --radius-lg: 0px;
    --radius-full: 0px;

    /* Shadows */
    --shadow-sm: 2px 2px 0 0 #000000;
    --shadow-md: 4px 4px 0 0 #000000;
    --shadow-lg: 8px 8px 0 0 #000000;
    --shadow-hover: 6px 6px 0 0 #000000;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    /* Borders */
    --border-width: 3px;
    --border-width-sm: 2px;
}

/* Dark theme variables */
[data-theme="dark"] {
    --primary-color: #ccff00;
    --primary-hover: #b3e600;
    --background: #050505;
    --surface: #111111;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --border-color: #333333;
    --text-on-primary: #000000;
    --accent-text: #ccff00;
    --shadow-sm: 2px 2px 0 0 #333333;
    --shadow-md: 4px 4px 0 0 #333333;
    --shadow-lg: 8px 8px 0 0 #333333;
    --shadow-hover: 6px 6px 0 0 #333333;
}

/* Base Styles */
body {
    font-family: 'Space Mono', monospace;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--background);
    background-image: radial-gradient(var(--text-secondary) 1px, transparent 1px);
    background-size: 20px 20px;
    margin: 0;
    padding: 20px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

/* Header */
/* Header */
.header {
    text-align: left;
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    position: relative;
    background: var(--surface);
    border: var(--border-width) solid var(--border-color);
    box-shadow: var(--shadow-md);
}

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

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border: var(--border-width-sm) solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-on-primary);
    position: relative;
    transition: all 0.2s ease;
}

.logo:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow-sm);
}

.logo svg {
    width: 24px;
    height: 24px;
    stroke-width: 2.5px;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -1px;
    text-transform: uppercase;
}

.brand-divider {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0.5rem;
}

.header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.github-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    background: var(--surface);
    border: var(--border-width-sm) solid var(--border-color);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.github-link:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow-md);
    background: var(--primary-color);
}

.github-link svg {
    width: 16px;
    height: 16px;
}

.header-accent {
    display: none;
    /* Removed for brutalist style */
}

/* Step Indicator */
/* Step Indicator */
.step-indicator {
    margin: var(--spacing-xl) 0;
    position: relative;
}

/* Container for steps */
.steps-container {
    display: flex;
    justify-content: space-between;
    background: var(--surface);
    border: var(--border-width) solid var(--border-color);
    padding: 0.5rem;
    position: relative;
    box-shadow: var(--shadow-md);
}

/* Progress fill that animates behind the steps */
.steps-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--primary-color);
    z-index: 0;
    transition: width 0.3s ease;
    border-right: var(--border-width) solid var(--border-color);
    opacity: 0.5;
}

/* Progress states */
.step-indicator[data-step="1"] .steps-container::before {
    width: 0;
    border: none;
}

.step-indicator[data-step="2"] .steps-container::before {
    width: 25%;
}

.step-indicator[data-step="3"] .steps-container::before {
    width: 50%;
}

.step-indicator[data-step="4"] .steps-container::before {
    width: 75%;
}

.step-indicator[data-step="complete"] .steps-container::before {
    width: 100%;
}

/* Individual step styling */
.step {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1;
    flex: 1;
    justify-content: space-between;
    padding: 0.5rem 1rem;
}

/* Step label */
.step span {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    transition: all 0.3s ease;
    white-space: nowrap;
    order: 1;
}

/* Number bubble */
.step-number {
    width: 32px;
    height: 32px;
    background: var(--surface);
    border: var(--border-width-sm) solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-primary);
    transition: all 0.3s ease;
    order: 2;
}

/* Active state */
.step.active .step-number {
    background: var(--primary-color);
    color: var(--text-on-primary);
    box-shadow: var(--shadow-sm);
    transform: translate(-2px, -2px);
}

.step.active span {
    color: var(--text-primary);
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

/* Completed state */
.step.completed .step-number {
    background: var(--text-primary);
    color: var(--surface);
    border-color: var(--text-primary);
}

.step.completed span {
    color: var(--text-primary);
}

/* Future state */
.step.future .step-number {
    background: var(--background);
    color: var(--text-secondary);
    border-style: dashed;
}

.step.future span {
    color: var(--text-secondary);
}

/* Cards */
.card {
    background: var(--surface);
    border: var(--border-width) solid var(--border-color);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translate(-2px, -2px);
}

/* Input Groups */
.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-field {
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
    padding: 1rem;
    border: var(--border-width-sm) solid var(--border-color);
    border-radius: 0;
    font-size: 1rem;
    font-family: 'Space Mono', monospace;
    transition: all 0.2s ease;
    background: var(--surface);
    color: var(--text-primary);
}

.input-field:focus {
    outline: none;
    border-color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    background: var(--primary-color);
    color: var(--text-primary);
}

.input-help {
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 700;
}

/* Radio Groups */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.radio-option {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: var(--spacing-lg);
    border: var(--border-width-sm) solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--surface);
}

.radio-option:hover:not(:disabled) {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow-sm);
    background: var(--primary-color);
}

.radio-option input[type="radio"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    background: var(--surface);
    margin-top: 0.25rem;
    cursor: pointer;
}

.radio-option input[type="radio"]:checked {
    background: var(--text-primary);
    box-shadow: inset 0 0 0 4px var(--primary-color);
}

.radio-option input[type="radio"]:checked+.radio-label {
    color: var(--text-primary);
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

.radio-label {
    font-weight: 700;
    display: block;
    text-transform: uppercase;
}

.radio-help {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: block;
    margin-top: 0.25rem;
    font-weight: 400;
}

/* Comparison Elements */
.comparison-elements {
    display: flex;
    gap: var(--spacing-xl);
    margin: var(--spacing-xl) 0;
}

.element-card {
    flex: 1;
    padding: var(--spacing-xl);
    background: var(--surface);
    text-align: center;
    font-weight: 700;
    font-size: 1.25rem;
    border: var(--border-width) solid var(--border-color);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    text-transform: uppercase;
}

.element-card.selected {
    background: var(--primary-color);
    color: var(--text-on-primary);
    transform: translate(-4px, -4px);
    box-shadow: var(--shadow-md);
}

.slider-container {
    background: var(--background);
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin: 2rem 0;
    border: 1px solid var(--border-color);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
}

.slider-label {
    text-align: center;
    transition: all 0.2s ease;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
}

.slider-label.selected {
    color: var(--primary-color);
    font-weight: 600;
    transform: scale(1.05);
}

/* Navigation Buttons */
.comparison-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    gap: 1rem;
    padding: 1rem;
    background: var(--background);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
    text-align: center;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Slider */
.slider-container {
    margin: 2rem 0;
}

/* Segmented choice */
.segmented-container {
    margin: 1rem 0 2rem;
}

.segmented {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    background: var(--background);
    padding: 0.5rem;
    border: var(--border-width) solid var(--border-color);
}

.segmented input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.segmented label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.5rem;
    text-align: center;
    cursor: pointer;
    border: var(--border-width-sm) solid var(--border-color);
    color: var(--text-primary);
    background: var(--surface);
    transition: all 0.2s ease;
    min-height: 44px;
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
}

.segmented input[type="radio"]:focus+label,
.segmented label:focus {
    outline: none;
    background: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.segmented input[type="radio"]:checked+label {
    color: var(--text-on-primary);
    background: var(--primary-color);
    box-shadow: var(--shadow-sm);
    transform: translate(-2px, -2px);
}

/* Progress Bar */
.progress-container {
    background: var(--surface);
    padding: 1.5rem;
    margin: 2rem 0;
    border: var(--border-width) solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.progress-bar {
    height: 16px;
    background: var(--surface);
    border: var(--border-width-sm) solid var(--border-color);
    overflow: hidden;
    margin: 0.5rem 0;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
    border-right: var(--border-width-sm) solid var(--border-color);
}

.progress-text {
    text-align: center;
    color: var(--text-primary);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* Buttons */
.button-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: center;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    border: var(--border-width-sm) solid var(--border-color);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    min-width: 160px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--surface);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.btn:hover:not(:disabled) {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow-md);
}

.btn:active:not(:disabled) {
    transform: translate(0, 0);
    box-shadow: none;
}

.btn-icon {
    font-size: 1.25rem;
    transition: transform 0.2s ease;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--text-on-primary);
    /* High contrast black on neon */
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

.btn-primary:hover .btn-icon {
    transform: translateX(4px);
}

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

.btn-success:hover:not(:disabled) {
    background: #e600e6;
}

.btn-success:hover .btn-icon {
    transform: translateY(2px);
}

/* Results Table */
.result-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
    border: var(--border-width) solid var(--border-color);
    box-shadow: var(--shadow-md);
    margin: 2rem 0;
}

.result-table th {
    background: var(--background);
    padding: 1rem;
    font-weight: 700;
    text-align: left;
    border-bottom: var(--border-width-sm) solid var(--border-color);
    text-transform: uppercase;
}

.result-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
    font-family: 'Space Mono', monospace;
}

.result-table tr:last-child td {
    border-bottom: none;
}

.result-table tr:hover td {
    background-color: var(--primary-color);
    color: var(--text-on-primary);
}

/* Summary List Improvements */
.summary-list {
    list-style: none;
    padding: 0;
    margin: 2rem 0;
}

.summary-list li {
    background: var(--surface);
    padding: 1rem;
    margin-bottom: 1rem;
    border: var(--border-width-sm) solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.summary-list li:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow-md);
    background: var(--primary-color);
    color: var(--text-on-primary);
}

.summary-list li>div {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Evaluation Matrix */
.evaluation-matrix {
    margin: 2rem 0;
    width: 100%;
    min-width: 0;
}

.evaluation-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin: 2rem 0;
    overflow: visible;
}

.evaluation-table th {
    background: var(--background);
    padding: 1rem;
    font-weight: 600;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
}

.evaluation-table td {
    padding: 0.75rem;
    min-width: 100px;
    box-sizing: border-box;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.evaluation-table tr:last-child td {
    border-bottom: none;
}

.evaluation-table tr:hover td {
    background-color: var(--background);
}

.rating-input {
    width: 60px;
    padding: 0.5rem;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 1rem;
    transition: all 0.2s ease;
}

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

.rating-input:invalid {
    border-color: #ef4444;
    background-color: rgba(239, 68, 68, 0.05);
}

/* N/A toggle next to rating input */
/* N/A toggle removed per user request */

/* Quick fill buttons per row */
.quickfill-col {
    min-width: 220px;
}

.add-option-col {
    min-width: 120px;
}

.quickfill {
    white-space: nowrap;
}

.quickfill-group {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.btn-quick {
    padding: 0.25rem 0.5rem;
    min-width: 32px;
    font-size: 0.875rem;
}

.btn-quick.secondary {
    background: var(--background);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* Option header controls */
.option-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.option-name-input {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.25rem 0.5rem;
    font: inherit;
    width: 100%;
    background: var(--surface);
}

.btn-icon.remove-option {
    min-width: auto;
    padding: 0.25rem 0.5rem;
    background: var(--background);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-small {
    padding: 0.375rem 0.75rem;
    min-width: auto;
}

/* Rating Help Panel */
.rating-help {
    background: var(--background);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin: 2rem 0;
    border: 1px solid var(--border-color);
}

.rating-help h4 {
    margin: 0 0 1rem;
    color: var(--text-primary);
}

.rating-scale {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.5rem;
    margin-top: 1rem;
}

.rating-point {
    padding: 0.75rem;
    min-width: 0;
    text-align: center;
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.rating-point strong {
    display: block;
    font-size: 1.25rem;
    color: var(--accent-text);
    margin-bottom: 0.5rem;
}

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

/* Final Rankings */
.ranking-item {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    margin: 0.5rem 0;
    background: var(--background);
    border-radius: var(--radius-md);
    width: 100%;
    box-sizing: border-box;
}

.ranking-details {
    flex: 1;
    min-width: 200px;
}

.ranking-score {
    font-weight: 600;
    color: var(--accent-text);
}

.score-bar-container {
    margin-top: 0.5rem;
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.score-bar {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

/* Make sure future steps have muted colors */
.step.future .step-number {
    background: white;
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.step.future span {
    color: var(--text-secondary);
}

.comparison-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    gap: 1rem;
}

.comparison-navigation button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn {
    min-width: 100px;
}

.file-upload {
    margin-top: 10px;
}

.file-upload input[type="file"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.separator {
    text-align: center;
    margin: 2rem 0;
    position: relative;
}

.separator::before,
.separator::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 2rem);
    height: 1px;
    background-color: var(--border-color);
}

.separator::before {
    left: 0;
}

.separator::after {
    right: 0;
}

.separator span {
    background-color: white;
    padding: 0 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.matrix-upload {
    background-color: var(--background);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 0;
    transition: all 0.3s ease;
}

.matrix-upload .btn {
    margin-top: 1rem;
    width: 100%;
}

.matrix-upload .input-help {
    transition: color 0.3s ease;
}

#skipToEvaluationBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#skipToEvaluationBtn:not(:disabled) {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

/* Add success state styles */
.matrix-upload.success {
    background-color: rgba(22, 163, 74, 0.1);
    /* var(--success-color) with opacity */
}

.comparison-input,
.matrix-input {
    transition: all 0.3s ease;
}

.matrix-input {
    background-color: var(--background);
    padding: 1.5rem;
    border-radius: var(--radius-md);
}

/* Add hover effects only to interactive elements */
.btn:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    /* Remove hover effects for disabled buttons */
    transform: none;
    box-shadow: none;
}

/* Add focus styles for better keyboard navigation */
.radio-option:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Add these new styles */
.loading-state,
.success-state,
.error-state {
    text-align: center;
    padding: 2rem;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.success-state {
    border-color: var(--success-color);
    background: rgba(16, 185, 129, 0.05);
}

.error-state {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

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

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

.success-icon {
    width: 40px;
    height: 40px;
    background: var(--success-color);
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
}

.error-icon {
    width: 40px;
    height: 40px;
    background: #ef4444;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
}

/* Add transition effects for section changes */
#setup,
#comparison,
#results,
#evaluation,
#finalResults {
    transition: opacity 0.3s ease;
}

.fade-out {
    opacity: 0;
}

.fade-in {
    opacity: 1;
}

.weight-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--primary-color);
    color: var(--text-on-primary);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Add hover tooltips for criteria */
.evaluation-table td:first-child {
    position: relative;
}

.evaluation-table td:first-child:hover::after {
    content: "Criterion weight shown in next column";
    position: absolute;
    bottom: 100%;
    left: 0;
    background: var(--text-primary);
    color: white;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 1;
}

/* Section Headers */
.section-header {
    margin-bottom: 2rem;
    text-align: center;
}

.section-header h2 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

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

/* Setup Section */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.radio-option {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.radio-option:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.radio-option.selected {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.05);
}

.input-group {
    background: var(--background);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin: 1.5rem 0;
    border: 1px solid var(--border-color);
}

.input-field {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.2s ease;
    background: var(--surface);
}

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

/* Add these styles after the existing .success-state styles */
.success-state .file-upload-container,
.error-state .file-upload-container {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.success-state .input-field,
.error-state .input-field {
    margin-bottom: 0.5rem;
}

.success-state .input-help {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0;
}

.error-state .input-help {
    color: #ef4444;
    font-size: 0.875rem;
    margin: 0;
}

/* Update and add these styles */
.success-state,
.error-state {
    text-align: center;
    padding: 2rem;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.success-state {
    border-color: var(--success-color);
    background: rgba(16, 185, 129, 0.05);
}

.error-state {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.success-title,
.error-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1rem 0;
}

.matrix-info {
    background: var(--surface);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin: 1rem 0;
    border: 1px solid var(--border-color);
}

.file-name {
    font-weight: 500;
    margin: 0;
}

.matrix-details {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0.25rem 0 0;
}

.error-message {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    margin: 1rem 0;
}

.file-change-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-change-btn:hover {
    background: var(--background);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.file-change-btn.error {
    border-color: #ef4444;
    color: #ef4444;
}

.file-change-btn.error:hover {
    background: rgba(239, 68, 68, 0.05);
}

.change-icon {
    font-size: 1.25rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Add animation for the ready state of the start button */
.btn.ready {
    animation: readyPulse 2s infinite;
}

@keyframes readyPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

/* Add these tooltip styles */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    background: var(--text-primary);
    color: white;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 10;
}

[data-tooltip]:hover:before {
    opacity: 1;
    transform: translateX(-50%) translateY(-0.5rem);
}

/* Add transition animations */
.section-transition {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.section-transition.active {
    opacity: 1;
    transform: translateY(0);
}

/* Add loading skeleton styles */
.skeleton {
    background: linear-gradient(90deg,
            var(--background) 25%,
            var(--border-color) 50%,
            var(--background) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Add responsive padding for smaller screens */
@media (max-width: 600px) {
    .card {
        padding: var(--spacing-md);
    }

    .button-container {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    /* Header Responsiveness */
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .header-actions {
        width: 100%;
        display: flex;
        justify-content: space-between;
    }

    /* Comparison Responsiveness */
    .comparison-elements {
        flex-direction: column;
        gap: 1rem;
    }

    /* Segmented Control Responsiveness */
    .segmented {
        grid-template-columns: 1fr;
    }

    /* Step Indicator Responsiveness */
    .step span {
        display: none;
    }

    .step {
        justify-content: center;
    }
}

/* Add wrapper for horizontal scrolling if needed */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-lg);
    padding: 1px;
}

/* Results Section Improvements */
.result-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin: 2rem 0;
}

/* Table wrapper for horizontal scrolling */
.results-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-lg);
    margin: 2rem 0;
}

/* Results header */
.results-header {
    text-align: center;
    margin-bottom: 2rem;
}

.results-header h2 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

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

/* Summary section */
.results-summary {
    background: var(--background);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.summary-list {
    margin: 0;
}

.summary-list li {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: var(--surface);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

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

.ranking-position {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--accent-text);
    margin-right: 1rem;
    min-width: 2rem;
}

.ranking-details {
    flex: 1;
}

.ranking-details h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
}

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

.score-bar-container {
    flex: 1;
    height: 8px;
    background: var(--border-color);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.score-value {
    font-weight: 500;
    color: var(--accent-text);
    min-width: 4rem;
    text-align: right;
}

/* Detailed results section */
.detailed-results {
    margin-top: 2rem;
}

.detailed-results h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* Section tabs */
.results-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: var(--background);
    padding: 0.5rem;
    border-radius: var(--radius-lg);
}

.tab-button {
    padding: 0.75rem 1.5rem;
    border: var(--border-width-sm) solid var(--border-color);
    background: var(--surface);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    text-align: center;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: var(--shadow-sm);
}

.tab-button:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
}

.tab-button.active {
    background: var(--primary-color);
    color: var(--text-on-primary);
    box-shadow: var(--shadow-sm);
    transform: none;
}

/* Add these new styles for the download button states */
.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 0.5rem;
}

.success-icon-small {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    margin-right: 0.5rem;
    font-size: 0.875rem;
}

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

.btn.success:hover {
    background: #0ea371;
}

.btn.success .success-icon-small {
    transform: scale(1);
    opacity: 1;
}

/* Add these new styles for the theme toggle */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    color: var(--text-primary);
    background: var(--background);
}

.theme-toggle .sun-icon,
.theme-toggle .moon-icon {
    width: 18px;
    height: 18px;
    transition: all 0.2s ease;
}

/* Show/hide icons based on theme */
[data-theme="dark"] .theme-toggle .sun-icon {
    display: block;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: none;
}

[data-theme="light"] .theme-toggle .sun-icon {
    display: none;
}

[data-theme="light"] .theme-toggle .moon-icon {
    display: block;
}

/* Add smooth transitions for theme changes */
body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Update card and input styles for better dark mode contrast */
.card,
.input-field,
.radio-option,
.element-card {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* Improve dark mode slider track visibility */
[data-theme="dark"] .slider {
    background: var(--border-color);
}

[data-theme="dark"] .slider::-webkit-slider-thumb {
    box-shadow: 0 0 0 2px var(--surface);
}

/* Add these styles for better dark mode input states */
[data-theme="dark"] .input-field:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

[data-theme="dark"] .radio-option:hover:not(:disabled) {
    background: rgba(96, 165, 250, 0.1);
    border-color: var(--primary-light);
}

/* Improve button contrast in dark mode */
[data-theme="dark"] .btn-primary {
    background: var(--primary-color);
    color: var(--surface);
}

[data-theme="dark"] .btn-primary:hover {
    background: var(--primary-light);
}

[data-theme="dark"] .btn-success {
    background: var(--success-color);
    color: var(--surface);
}

/* Improve slider visibility in dark mode */
[data-theme="dark"] .slider {
    background: var(--border-color);
}

[data-theme="dark"] .slider::-webkit-slider-thumb {
    background: var(--primary-color);
    box-shadow: 0 0 0 2px var(--surface);
}

/* Improve card and element visibility */
[data-theme="dark"] .element-card.selected {
    border-color: var(--primary-color);
    background: rgba(96, 165, 250, 0.1);
}

/* Improve step indicator contrast */
[data-theme="dark"] .step.active .step-number {
    background: var(--primary-color);
    color: var(--surface);
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.2);
}

/* Improve theme toggle visibility */
[data-theme="dark"] .theme-toggle {
    color: var(--text-secondary);
}

[data-theme="dark"] .theme-toggle:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

/* Add focus styles for better keyboard navigation */
[data-theme="dark"] *:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Improve table contrast in dark mode */
[data-theme="dark"] .result-table th,
[data-theme="dark"] .evaluation-table th {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .result-table tr:hover td,
[data-theme="dark"] .evaluation-table tr:hover td {
    background: rgba(255, 255, 255, 0.05);
}

/* Improve progress bar visibility */
[data-theme="dark"] .progress-bar {
    background: var(--border-color);
}

[data-theme="dark"] .progress-fill {
    background: var(--primary-color);
}

/* Add subtle hover effects for interactive elements */
[data-theme="dark"] .card:hover,
[data-theme="dark"] .element-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

/* Add these styles to fix text colors in dark mode */
[data-theme="dark"] .input-field {
    color: var(--text-primary);
    /* Make input text visible */
    background: var(--surface);
}

[data-theme="dark"] .input-field::placeholder {
    color: var(--text-secondary);
    /* Lighter placeholder text */
}

/* Fix button text colors */
[data-theme="dark"] .btn {
    color: var(--text-primary);
    /* Default button text color */
}

[data-theme="dark"] .btn-primary {
    color: #ffffff;
    /* White text for primary buttons */
}

[data-theme="dark"] .btn-success {
    color: #ffffff;
    /* White text for success buttons */
}

/* Fix radio button text */
[data-theme="dark"] .radio-label {
    color: var(--text-primary);
}

[data-theme="dark"] .radio-help {
    color: var(--text-secondary);
}

/* Fix GitHub link text */
[data-theme="dark"] .github-link {
    color: var(--text-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .github-link:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
}

/* Fix disabled button states */
[data-theme="dark"] .btn:disabled {
    color: var(--text-secondary);
    opacity: 0.5;
}

/* Fix secondary buttons */
[data-theme="dark"] .btn-secondary {
    background: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .btn-secondary:hover {
    background: var(--text-secondary);
}

/* Fix tab buttons */
[data-theme="dark"] .tab-button {
    color: var(--text-secondary);
}

[data-theme="dark"] .tab-button.active {
    color: var(--primary-color);
}

/* Fix slider labels */
[data-theme="dark"] .slider-labels span {
    color: var(--text-secondary);
}

[data-theme="dark"] .slider-labels span.selected {
    color: var(--text-primary);
}

/* Fix progress text */
[data-theme="dark"] .progress-text {
    color: var(--text-secondary);
}

/* Fix table text */
[data-theme="dark"] .result-table td,
[data-theme="dark"] .evaluation-table td {
    color: var(--text-primary);
}

[data-theme="dark"] .result-table th,
[data-theme="dark"] .evaluation-table th {
    color: var(--text-primary);
}

/* Fix rating inputs */
[data-theme="dark"] .rating-input {
    color: var(--text-primary);
    background: var(--surface);
}

/* Fix rating help text */
[data-theme="dark"] .rating-help {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .rating-point {
    background: var(--surface);
}

[data-theme="dark"] .rating-point strong {
    color: var(--primary-color);
}

[data-theme="dark"] .rating-point span {
    color: var(--text-secondary);
}

/* Footer */
.footer {
    margin-top: 4rem;
    padding: 2rem 0;
    text-align: center;
    border-top: var(--border-width) solid var(--border-color);
    color: var(--text-secondary);
}

.footer p {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
}

.footer a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 700;
}

.footer a:hover {
    text-decoration: underline;
    color: var(--primary-color);
}

/* Ensure consistent button styling */
.btn-quick,
.btn-small {
    border-radius: var(--radius-md);
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    text-transform: uppercase;
}