:root {
    --primary-color: #0a3d62; /* Dark blue from NextLeader site */
    --secondary-color: #3498db; /* Lighter blue for accents */
    --accent-color: #f39c12; /* Orange accent for highlights */
    --text-color: #2c3e50; /* Dark text color */
    --light-bg: #f5f9fc; /* Light background color */
    --white: #ffffff;
    --light-gray: #f5f5f5;
    --border-gray: #e0e0e0;
    --success-color: #27ae60; /* Green for success messages */
}

body {
    font-family: 'Montserrat', 'Arial', sans-serif;
    line-height: 1.6;
    background-color: var(--light-bg);
    color: var(--text-color);
}

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

/* Add styles for the header and logo */
.header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-gray);
}

.logo {
    margin-right: 20px;
}

.logo a {
    display: inline-block;
    text-decoration: none;
    cursor: pointer;
}

.logo a:hover {
    opacity: 0.9;
}

.logo img {
    max-height: 60px;
    width: auto;
}

h1 {
    text-align: left;
    margin-bottom: 0;
    color: var(--primary-color);
    flex-grow: 1;
    font-weight: 600;
}

@media (max-width: 600px) {
    .header {
        flex-direction: column;
        text-align: center;
    }
    
    .logo {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    h1 {
        text-align: center;
    }
}

.screen {
    display: none;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.screen.active {
    display: block;
}

h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
    font-weight: 600;
}

p {
    margin-bottom: 20px;
}

.btn {
    display: block;
    width: 200px;
    margin: 20px auto;
    padding: 10px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    font-weight: 500;
}

.btn:hover {
    background-color: #0d4d7a; /* Slightly darker blue on hover */
    transform: translateY(-2px);
}

.progress-bar {
    height: 12px;
    background-color: #eee;
    border-radius: 6px;
    margin: 25px 0;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.progress {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 6px;
    width: 0%;
    transition: width 0.5s ease;
}

#top-values-list {
    margin: 20px 0;
    padding-left: 20px;
}

#top-values-list li {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
}

#top-values-list li:last-child {
    border-bottom: none;
}

.value-item {
    margin-bottom: 25px;
    padding: 20px;
    border-radius: 8px;
    background-color: var(--white);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-left: 4px solid var(--primary-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.value-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.value-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 0; /* Removed padding */
    border-bottom: none; /* Removed border */
}

.value-icon {
    font-size: 24px;
    margin-right: 10px;
    background-color: #f0f8ff;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.value-content {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
}

.value-name {
    font-weight: 600;
    font-size: 18px;
    color: var(--primary-color);
    margin-right: 8px;
    white-space: nowrap;
}

.value-definition {
    font-style: italic;
    color: #666;
    line-height: 1.4;
    display: inline;
}

.likert-scale {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
    flex-wrap: nowrap; /* Prevent wrapping */
    width: 100%; /* Ensure full width */
}

.likert-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 20%; /* Equal width for all 5 options */
    cursor: pointer;
    padding: 8px 2px; /* Reduced horizontal padding */
    border-radius: 5px;
    transition: background-color 0.2s;
    text-align: center;
    min-width: 0; /* Allow shrinking if needed */
}

.likert-option:hover {
    background-color: rgba(10, 61, 98, 0.1); /* Light primary color */
}

.likert-option input {
    margin-bottom: 5px;
    cursor: pointer;
    transform: scale(1.2);
}

.likert-option label {
    text-align: center;
    font-size: 12px; /* Smaller font size */
    cursor: pointer;
    font-weight: 500;
    white-space: nowrap; /* Prevent text wrapping */
    overflow: hidden;
    text-overflow: ellipsis; /* Add ellipsis for overflow text */
    width: 100%;
}

/* For smaller screens, adjust the font size further */
@media (max-width: 768px) {
    .likert-option label {
        font-size: 10px;
    }
}

/* For very small screens, allow wrapping as a fallback */
@media (max-width: 480px) {
    .likert-scale {
        flex-wrap: wrap;
    }
    
    .likert-option {
        width: 33.33%; /* 3 options per row on very small screens */
        margin-bottom: 5px;
    }
}

/* Reset radio button styles to ensure proper appearance */
.likert-option input[type="radio"] {
    -webkit-appearance: radio;
    -moz-appearance: radio;
    appearance: radio;
    margin-bottom: 5px;
    cursor: pointer;
    transform: scale(1.2);
    opacity: 1;
    position: static;
    width: auto;
    height: auto;
}

/* Ensure radio buttons have their native appearance */
.likert-option input[type="radio"]::before,
.likert-option input[type="radio"]::after {
    content: none;
}

/* Keep all value borders the same color regardless of rating */
.value-item {
    border-left: 4px solid var(--primary-color);
}

/* Use a consistent background color for all rated values */
.value-item.rated {
    background-color: rgba(10, 61, 98, 0.05); /* Light primary color background for all rated values */
}

/* Remove the different background colors for different ratings */
/*
.value-item.rated-1 {
    background-color: rgba(231, 76, 60, 0.05);
}

.value-item.rated-2 {
    background-color: rgba(230, 126, 34, 0.05);
}

.value-item.rated-3 {
    background-color: rgba(243, 156, 18, 0.05);
}

.value-item.rated-4 {
    background-color: rgba(41, 128, 185, 0.05);
}

.value-item.rated-5 {
    background-color: rgba(10, 61, 98, 0.05);
}
*/

/* Exception for unrated highlights - these should still have red borders and background */
.value-item.unrated-highlight {
    border: 2px solid #e74c3c;
    border-left: 4px solid #e74c3c;
    background-color: rgba(231, 76, 60, 0.05);
    box-shadow: 0 0 8px rgba(231, 76, 60, 0.3);
}

@media (max-width: 600px) {
    .likert-option {
        width: 18%;
    }
    
    .likert-option label {
        font-size: 11px;
    }
}

/* Add spacing between values */
#values-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.refinement-value-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.refinement-value {
    font-weight: bold;
    display: flex;
    align-items: center;
    margin-right: 8px;
    color: #2c3e50;
}

.refinement-definition {
    font-style: italic;
    color: #666;
    font-size: 14px;
    margin-top: 5px;
}

.refinement-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    padding: 15px;
    background-color: var(--white);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.refinement-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    justify-content: flex-end;
}

.refinement-btn {
    padding: 8px 15px;
    background-color: #e0e0e0;
    color: #333;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.refinement-btn:hover {
    background-color: #d0d0d0;
}

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

.refinement-btn:first-child.selected {
    background-color: #e74c3c;
}

.refinement-btn:last-child.selected {
    background-color: var(--secondary-color);
}

/* Add these styles for pagination controls */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
}

.pagination-btn {
    padding: 8px 15px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    min-width: 100px; /* Ensure button doesn't resize when text changes */
    transition: background-color 0.3s, transform 0.2s;
    font-weight: 500;
}

.pagination-btn:hover {
    background-color: #0d4d7a; /* Slightly darker blue on hover */
    transform: translateY(-2px);
}

.pagination-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#next-btn:last-of-type {
    font-weight: bold;
}

#page-indicator {
    font-weight: bold;
}

.refinement-counter {
    background-color: #f0f0f0;
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
}

#more-important-counter {
    color: #3498db;
    font-size: 18px;
}

.required-asterisk {
    color: #e74c3c;
    font-weight: bold;
    margin-left: 5px;
}

/* Styles for highlighting unrated values */
.value-item.unrated-highlight {
    border: 2px solid #e74c3c;
    border-left: 4px solid #e74c3c;
    background-color: rgba(231, 76, 60, 0.05);
    box-shadow: 0 0 8px rgba(231, 76, 60, 0.3);
}

/* Animation for unrated values */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

/* Exception for unrated highlights - these should still have red borders and background */
.value-item.unrated-highlight {
    border: 2px solid #e74c3c;
    border-left: 4px solid #e74c3c;
    background-color: rgba(231, 76, 60, 0.05);
    box-shadow: 0 0 8px rgba(231, 76, 60, 0.3);
}

.required-asterisk {
    color: #e74c3c;
    font-weight: bold;
}

/* Ranking screen styles */
.ranking-instructions {
    margin-bottom: 20px;
    font-style: italic;
}

.ranking-list {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 20px;
}

.rank-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background-color: var(--white);
    border-radius: 5px;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    cursor: move;
    user-select: none;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
}

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

.rank-number {
    font-weight: bold;
    margin-right: 10px;
    color: var(--primary-color);
    width: 25px;
}

.rank-value {
    font-weight: bold;
    color: var(--text-color);
    margin-right: 8px;
}

.rank-definition {
    width: 100%;
    margin-top: 5px;
    font-style: italic;
    color: #666;
    font-size: 14px;
}

.drag-handle {
    color: #999;
    cursor: move;
    font-size: 20px;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

.rank-item.dragging {
    opacity: 0.6;
    background-color: #f0f8ff;
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    z-index: 10;
}

.rank-item.drag-over {
    border-top: 2px solid var(--primary-color);
    padding-top: 13px; /* Adjust padding to compensate for border */
}

/* Add a visual indicator for where the item will be dropped */
.rank-item.drag-over::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary-color);
    z-index: 5;
}

.result-value {
    font-weight: bold;
    color: var(--text-color);
    margin-right: 8px;
    white-space: nowrap;
}

.result-definition {
    color: #666;
    display: inline;
    font-style: italic;
}

.button-container {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.secondary-btn {
    background-color: #95a5a6;
}

.secondary-btn:hover {
    background-color: #7f8c8d;
}

/* Email form styles */
#email-form-container {
    background-color: var(--white);
    border-radius: 8px;
    padding: 20px;
    margin: 30px 0;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

#email-form-container h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="email"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-gray);
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(10, 61, 98, 0.1);
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-group input {
    margin-right: 10px;
}

.checkbox-group label {
    margin-bottom: 0;
    font-weight: normal;
}

.submit-btn {
    background-color: var(--primary-color);
    margin-top: 10px;
}

.submit-btn:hover {
    background-color: #0d4d7a;
}

.success-message {
    color: var(--success-color);
    font-weight: bold;
    padding: 15px;
    background-color: rgba(39, 174, 96, 0.1);
    border-radius: 4px;
    border-left: 3px solid var(--success-color);
}

/* Final Reflections Section */
#final-reflections {
    margin: 30px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

#final-reflections h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.reflection-question {
    margin-bottom: 20px;
}

.reflection-question p {
    margin-bottom: 10px;
}

.reflection-question:last-child p {
    margin-bottom: 0;
}

/* Email form container styling */
#email-form-container {
    margin-top: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
}

#email-form-container h3 {
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.coaching-invitation-text {
    margin: 15px 0 20px;
    font-style: italic;
    color: #555;
    line-height: 1.5;
    font-size: 15px;
}

/* Remove or update the old coaching-invitation class */
.coaching-invitation {
    display: none; /* Hide the old container */
}

.coaching-invitation p {
    margin: 0;
    line-height: 1.5;
    color: var(--text-color);
    font-style: italic;
}

.checkbox-group {
    margin-top: 15px;
}

.form-group {
    margin-bottom: 15px;
}

.email-disclaimer {
    margin-top: 5px;
    font-size: 13px;
    color: #666;
    font-style: italic;
    text-align: left;
    background-color: transparent;
    padding: 0;
    border-radius: 0;
}

.email-disclaimer p {
    margin-bottom: 0;
}

/* Style for the results page buttons */
.results-buttons {
    margin: 30px 0;
    justify-content: center;
    gap: 20px;
}

/* Style for the rerank button container */
.rerank-button-container {
    margin: 20px 0 30px;
    justify-content: center;
}

/* Style for the restart button container */
.restart-button-container {
    margin: 30px 0;
    justify-content: center;
}

#back-to-ranking-btn {
    background-color: #95a5a6;
}

#back-to-ranking-btn:hover {
    background-color: #7f8c8d;
}

#restart-btn {
    background-color: #e74c3c;
}

#restart-btn:hover {
    background-color: #c0392b;
}

.rating-note {
    font-size: 14px;
    color: #777;
    font-style: italic;
    margin-top: -10px;
    margin-bottom: 15px;
    text-align: center;
}

/* Styles for other values section */
.other-values-section {
    margin: 30px 0;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
}

.other-values-section h3 {
    color: var(--secondary-color);
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.rating-section {
    margin-bottom: 20px;
}

.rating-section:last-child {
    margin-bottom: 0;
}

.rating-heading {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

.other-values-list {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.other-values-list li {
    display: flex;
    align-items: center;
    background-color: white;
    padding: 5px 10px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 0;
    border-bottom: none;
}

.other-values-list .value-icon {
    font-size: 18px;
    margin-right: 5px;
    background-color: #f0f8ff;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.other-value {
    font-weight: 500;
    color: #333;
}

/* Make the other values section responsive */
@media (max-width: 768px) {
    .other-values-list {
        flex-direction: column;
        gap: 5px;
    }
    
    .other-values-list li {
        width: 100%;
    }
}

/* Testing Controls */
.testing-controls {
    margin: 10px 0;
    text-align: center;
    padding: 8px;
    background-color: #f8d7da;
    border: 1px dashed #dc3545;
    border-radius: 4px;
}

.testing-btn {
    padding: 5px 10px;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin: 0 5px;
}

.testing-btn:hover {
    background-color: #c82333;
}

/* Sortable list styles */
.sortable-list {
    list-style-position: inside;
    padding: 0;
    margin: 20px 0;
}

.sortable-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background-color: var(--white);
    border-radius: 5px;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    cursor: move; /* Show move cursor */
    cursor: grab; /* Modern browsers */
    user-select: none;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
}

/* Focus styles for keyboard navigation */
.sortable-item:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(10, 61, 98, 0.3);
}

.sortable-item:focus:not(:focus-visible) {
    outline: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.sortable-item:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(10, 61, 98, 0.3);
}

.sortable-item[aria-grabbed="true"] {
    opacity: 0.8;
    background-color: #f0f8ff;
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    z-index: 10;
    cursor: grabbing; /* Modern browsers */
    border-left: 4px dashed var(--primary-color);
}

.value-icon {
    margin-right: 10px;
    font-size: 1.2em;
}

.value-name {
    font-weight: bold;
    color: var(--text-color);
    margin-right: 8px;
}

.value-definition {
    width: 100%;
    margin-top: 5px;
    font-style: italic;
    color: #666;
    font-size: 14px;
}

/* Add a visual indicator for drag position */
.sortable-item::after {
    content: '';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='3' y1='12' x2='21' y2='12'%3E%3C/line%3E%3Cline x1='3' y1='6' x2='21' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='18' x2='21' y2='18'%3E%3C/line%3E%3C/svg%3E");
    opacity: 0.5;
}

.sortable-item:hover::after {
    opacity: 0.8;
}

/* Make the reorder instructions more prominent but without background */
.reorder-instructions {
    padding: 10px 0;
    margin-bottom: 10px;
    font-weight: 500;
    color: var(--primary-color);
}

/* Coaching button styles */
.coaching-btn {
    display: block;
    width: 250px;
    margin: 20px auto;
    padding: 12px 15px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
}

.coaching-btn:hover {
    background-color: #0d4d7a;
    transform: translateY(-2px);
    text-decoration: none;
    color: var(--white);
}

/* Form success styling */
#form-success {
    text-align: center;
    padding: 20px;
    margin: 20px 0;
}

.success-message {
    color: var(--success-color);
    font-weight: 500;
    margin-bottom: 20px;
}

/* Button container for consistent spacing */
.button-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

/* Refinement instructions styling */
.refinement-instructions {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border-left: 4px solid var(--primary-color);
    border-radius: 4px;
}

.refinement-instructions p {
    margin: 0;
    color: #2c3e50;
}

/* Update counter styling */
.refinement-counter {
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f1f8ff;
    border-radius: 4px;
    font-weight: 500;
    color: var(--primary-color);
}

#more-important-counter {
    font-weight: 700;
}

/* Results navigation buttons */
.results-nav-buttons {
    margin: 20px 0;
    justify-content: flex-start; /* Align to the left */
}

#back-to-refinement-btn {
    background-color: #95a5a6;
    transition: background-color 0.3s, transform 0.2s;
}

#back-to-refinement-btn:hover {
    background-color: #7f8c8d;
    transform: translateY(-2px);
}

/* ADA-friendly styles */
.sortable-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background-color: var(--white);
    border-radius: 5px;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    cursor: move; /* Show move cursor */
    cursor: grab; /* Modern browsers */
    user-select: none;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
}

/* Focus styles for keyboard navigation */
.sortable-item:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(10, 61, 98, 0.3);
}

.sortable-item:focus:not(:focus-visible) {
    outline: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.sortable-item:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(10, 61, 98, 0.3);
}

.sortable-item[aria-grabbed="true"] {
    opacity: 0.8;
    background-color: #f0f8ff;
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    z-index: 10;
    cursor: grabbing; /* Modern browsers */
    border-left: 4px dashed var(--primary-color);
}

.drag-handle {
    color: #999;
    cursor: move;
    cursor: grab;
    font-size: 20px;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

.sortable-item[aria-grabbed="true"] .drag-handle {
    cursor: grabbing;
}

/* Screen reader only class */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Keyboard instructions - removed background, added italics */
.keyboard-instructions {
    margin-bottom: 15px;
    padding: 10px 0; /* Removed horizontal padding */
    font-size: 14px;
    color: #555;
    font-style: italic; /* Added italics */
    border-left: none; /* Removed left border */
    background-color: transparent; /* Removed background */
}

.keyboard-instructions p {
    margin: 0;
}

/* High contrast mode support */
@media (forced-colors: active) {
    .sortable-item {
        border: 2px solid CanvasText;
    }

    .sortable-item:focus,
    .sortable-item:focus-visible {
        outline: 3px solid Highlight;
    }

    .sortable-item[aria-grabbed="true"] {
        background-color: Canvas;
        border: 2px dashed Highlight;
    }

    /* Removed keyboard instructions border for high contrast mode */
}

/* Styles for checkbox-based selection interface */
.selection-counter {
    background-color: #f0f0f0;
    padding: 15px;
    margin-bottom: 25px;
    border-radius: 8px;
    text-align: center;
    font-size: 18px;
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.selection-counter.warning {
    background-color: #f8f9fa;
    border-left-color: #6c757d;
    color: #495057;
}

.selection-counter.success {
    background-color: #d4edda;
    border-left-color: #28a745;
    color: #155724;
}

.selection-counter.caution {
    background-color: #fff3cd;
    border-left-color: #ffc107;
    color: #856404;
}

.selection-counter.error {
    background-color: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

#selection-count {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
}

.selection-counter.success #selection-count {
    color: #28a745;
}

.selection-counter.warning #selection-count {
    color: #6c757d;
}

.selection-counter.caution #selection-count {
    color: #ffc107;
}

.selection-counter.error #selection-count {
    color: #dc3545;
}

.selectable-value {
    cursor: pointer;
    transition: all 0.3s ease;
}

.selectable-value:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.selectable-value.selected {
    background-color: rgba(10, 61, 98, 0.08);
    border-left-color: var(--secondary-color);
}

.value-checkbox {
    width: 20px;
    height: 20px;
    margin-right: 15px;
    cursor: pointer;
    flex-shrink: 0;
    transform: scale(1.3);
}

.value-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0;
}

/* Hide pagination controls on selection screen */
#rating-screen .pagination-controls {
    display: none;
}

/* Make the next button more prominent */
#rating-screen .pagination-btn {
    display: block;
    width: 200px;
    margin: 30px auto;
    padding: 12px;
    font-size: 18px;
    font-weight: 600;
}

/* Submit Results button styling */
.submit-results-btn {
    display: block;
    width: 250px;
    margin: 25px auto;
    padding: 14px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 4px;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.submit-results-btn:hover {
    background-color: #0d4d7a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Make selectable cards appear more clickable */
.selectable-value {
    cursor: pointer;
    user-select: none;
}

.selectable-value:active {
    transform: scale(0.98);
}

/* Comparison Screen Styles */
.comparison-instructions {
    text-align: center;
    font-size: 16px;
    color: #555;
    margin-bottom: 20px;
}

.comparison-progress {
    margin: 20px 0 30px;
}

.comparison-progress-bar {
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.comparison-progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
    width: 0%;
}

.comparison-counter {
    text-align: center;
    font-size: 14px;
    color: #666;
    margin: 0;
}

.comparison-round {
    text-align: center;
    font-size: 13px;
    color: var(--primary-color);
    font-weight: 600;
    margin: 5px 0 0 0;
}

.comparison-pair {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
    margin: 30px 0;
}

.comparison-option {
    flex: 1;
    max-width: 400px;
    padding: 30px 20px;
    background-color: var(--white);
    border: 3px solid var(--border-gray);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.comparison-option:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.comparison-option:active {
    transform: translateY(-2px) scale(1);
}

.comparison-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.comparison-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.comparison-value-name {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary-color);
}

.comparison-value-definition {
    font-size: 14px;
    color: #666;
    font-style: italic;
    line-height: 1.5;
}

.comparison-vs {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    padding: 10px;
    background-color: var(--light-bg);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .comparison-pair {
        flex-direction: column;
        gap: 15px;
    }

    .comparison-option {
        max-width: 100%;
        width: 100%;
    }

    .comparison-vs {
        transform: rotate(90deg);
    }

    .comparison-value-name {
        font-size: 20px;
    }

    .comparison-icon {
        font-size: 36px;
    }
}

/* Ranked List Styles */
.ranked-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.ranked-item {
    display: flex;
    align-items: flex-start;
    padding: 20px;
    margin-bottom: 15px;
    background-color: var(--white);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    gap: 15px;
}

.ranked-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.rank-number {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    min-width: 40px;
}

.ranked-value-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ranked-item .value-icon {
    font-size: 28px;
    background-color: #f0f8ff;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.ranked-item .value-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
}

.ranked-item .value-definition {
    font-size: 14px;
    color: #666;
    font-style: italic;
    margin-top: 5px;
}

.results-intro {
    text-align: center;
    font-size: 16px;
    color: #555;
    margin-bottom: 25px;
}

/* Comparison navigation buttons */
.comparison-nav-buttons {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.comparison-nav-buttons .btn {
    flex: 1;
    min-width: 150px;
    max-width: 250px;
}

#undo-comparison-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #ccc;
}

#undo-comparison-btn:disabled:hover {
    background-color: #ccc;
    transform: none;
}

@media (max-width: 600px) {
    .comparison-nav-buttons {
        flex-direction: column;
    }

    .comparison-nav-buttons .btn {
        width: 100%;
        max-width: 100%;
    }
}

/* MaxDiff Interface Styles */
.maxdiff-prompt-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 30px 0;
}

.maxdiff-prompt {
    padding: 15px 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    font-size: 18px;
}

.maxdiff-prompt.most-prompt {
    background-color: rgba(39, 174, 96, 0.1);
    border: 2px solid #27ae60;
    color: #155724;
}

.maxdiff-prompt.least-prompt {
    background-color: rgba(231, 76, 60, 0.1);
    border: 2px solid #e74c3c;
    color: #721c24;
}

.prompt-label {
    margin: 0;
    font-size: 16px;
}

.maxdiff-values-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.maxdiff-value-item {
    display: flex;
    align-items: center;
    padding: 20px;
    background-color: var(--white);
    border: 3px solid var(--border-gray);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    gap: 15px;
}

.maxdiff-value-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.maxdiff-value-item.selected-most {
    border-color: #27ae60;
    background-color: rgba(39, 174, 96, 0.08);
    border-width: 4px;
}

.maxdiff-value-item.selected-least {
    border-color: #e74c3c;
    background-color: rgba(231, 76, 60, 0.08);
    border-width: 4px;
}

.maxdiff-icon {
    font-size: 36px;
    background-color: #f0f8ff;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.maxdiff-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.maxdiff-value-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
}

.maxdiff-value-definition {
    font-size: 14px;
    color: #666;
    font-style: italic;
    line-height: 1.4;
}

/* Visual feedback for selected items */
.maxdiff-value-item.selected-most::after {
    content: '✓ MOST';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: bold;
    color: #27ae60;
    font-size: 14px;
    background-color: white;
    padding: 5px 10px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.maxdiff-value-item.selected-least::after {
    content: '✓ LEAST';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: bold;
    color: #e74c3c;
    font-size: 14px;
    background-color: white;
    padding: 5px 10px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.maxdiff-value-item {
    position: relative;
}

@media (max-width: 768px) {
    .maxdiff-value-item {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }

    .maxdiff-icon {
        font-size: 28px;
        width: 50px;
        height: 50px;
    }

    .maxdiff-value-name {
        font-size: 18px;
    }

    .maxdiff-value-definition {
        font-size: 13px;
    }

    .maxdiff-value-item.selected-most::after,
    .maxdiff-value-item.selected-least::after {
        position: static;
        transform: none;
        margin-top: 10px;
        display: inline-block;
    }

    .maxdiff-prompt {
        font-size: 16px;
        padding: 12px 15px;
    }

    .prompt-label {
        font-size: 14px;
    }
}
