:root {
/*
 * the following scaling factor k is calculated by  16px/<min-viewport-width-in-px-at-which-still-normal-font-size> e.g. 16px/640px = 0.025 → 2.5vw
 * the inner min()-statement handles wide screens (limits the font size from above),
 * the outer max()-statements handles small screens (limits the font size from below)
 * the factor 2.5  is the scaling factor for screens with medium width
 */
 --scaling-font-size: max(min(16px, 1.5vw), 10px);
 /* --scaling-font-size: 28px; */
}


body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f5f5f5;
    font-size: calc(var(--scaling-font-size)*1);
}

.container {
    /* max-width: 800px; */
    margin: 0 auto;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
}

.image-section {
    margin-bottom: 40px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fafafa;
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.image-container {
    text-align: center;
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}

.image-container img {
    max-width: 100%;
    /* max-height: 300px; */
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.image-overlay {
    position: absolute;
    top: 12%;
    right: 0;
    width: 70%;
    height: 86%;
    background-color: rgba(255,255,255,0.999);
    border-radius: 0 4px 4px 0;
}

.image-container h3 {
    margin: 10px 0;
    color: #555;
}

.sliders {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.slider-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.slider-group label {
    min-width: 120px;
    font-weight: bold;
    color: #333;
}

.slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4CAF50;
    cursor: pointer;
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4CAF50;
    cursor: pointer;
    border: none;
}

.slider-value {
    min-width: 20px;
    text-align: center;
    font-weight: bold;
    color: #4CAF50;
}

.buttons {
    text-align: center;
    margin-top: 30px;
    gap: 20px;
    display: flex;
    justify-content: center;
}

.submit-btn, .cancel-btn, .back-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s;
}

.submit-btn {
    background-color: #4CAF50;
    color: white;
}

.submit-btn:hover {
    background-color: #2b632e;
}

.submit-btn.inactive {
    background-color: #ccc;
    color: #666;
    /* cursor: not-allowed; */
}

.submit-btn.inactive:hover {
    background-color: #ccc;
}

.back-btn {
    background-color: #4c7aaf;
    color: white;
}

.back-btn:hover {
    background-color: #2d4969;
}

.cancel-btn {
    background-color: #f44336;
    color: white;
}

.cancel-btn:hover {
    background-color: #791812;
}


.rating-sections {
    display: flex;
    flex-direction: column;
    gap: 30px;
    flex: 1;
    min-width: 0;
}

.rating-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.rating-header {
    width: 100%;
}

.rating-header label {
    font-weight: bold;
    color: #333;
    display: block;
    margin-bottom: 5px;
}

.rating-header .explanation {
    margin: 0;
}



@media (max-width: 840px) {
    .slider-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .slider-group label {
        min-width: auto;
    }

    .buttons {
        flex-direction: column;
        gap: 10px;
    }

    .image-section {
        flex-direction: column;
        gap: 20px;
    }
}

.ratings {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.rating-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.rating-group > div:first-child {
    flex-shrink: 0;
}

.rating-group label {
    min-width: 100px;
    font-weight: bold;
}

.stars {
    gap: 5px;
    cursor: pointer;
}

.star-label {
    width: min-content;
    display: inline-block;
    font-size: 100%;
    color: #666;
}

.sl-left {
    /* position: absolute; */
    left: 0;
    text-align: left;
    /* transform: translateX(-20%); */
}

.sl-right {
    /* position: absolute; */
    right: 0;
    text-align: right;
}

.star-labels {
    position: relative;
    font-size: 12px;

    margin-bottom: 1.2em;
    width: 100%;
    height: 1em;
}

.star-container {
    display: flex;
    gap: 5px;
}

.star {
    /* font-size: 24px; */
    font-size: 200%;
    color: #ddd;
    transition: color 0.2s ease;
    user-select: none;
}

.star:hover,
.star.hover {
    color: #ffc107;
}

.star.active {
    color: #ff9800;
}

.explanation {
    font-size: 0.8em;
    color: #666;
    margin: 5px 0;
    font-weight: normal;
}

.completion-message h2 {
    text-align: center;
}

.completion-message p {
    text-align: left;
}

.ratings-summary {
    margin: 30px 0;
}

.ratings-summary h3 {
    color: #333;
    margin-bottom: 20px;
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.summary-table th,
.summary-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.summary-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #333;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.summary-table tr:hover {
    background-color: #f5f5f5;
}

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

.star-display {
    display: inline-flex;
    gap: 2px;
    margin-right: 8px;
}

.star-display .star {
    font-size: 16px;
    color: #ddd;
}

.star-display .star.filled {
    color: #ff9800;
}

.completion-buttons {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Modal styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(109, 109, 109, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    text-align: center;
    max-width: min(400px, 70vw);
    width: 90%;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #333;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s;
}

.modal-btn.secondary {
    /* background-color: #6c757d; */
    background-color: #c47f00ff;
    color: white;
}

.modal-btn.secondary:hover {
    /* background-color: #545b62; */
    background-color: #a16a02ff;
}

.modal-btn.primary {
    background-color: #4CAF50;
    color: white;
}

.modal-btn.primary:hover {
    background-color: #2b632e;
}

.dim,
.dim * {
    opacity: 0.1;
    pointer-events: none;
}

/* Footer styles - ensures footer is always at bottom and requires scrolling */

.non-footer {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 20px;
    font-size: 14px;
}

.footer p {
    margin: 0;
}

.footer a {
    color: hsl(200, 30%, 80%)
}

@media (max-width: 768px) {
    .summary-table {
        font-size: 14px;
    }

    .summary-table th,
    .summary-table td {
        padding: 8px 10px;
    }

    .star-display .star {
        font-size: 14px;
    }

    .completion-buttons {
        flex-direction: column;
        align-items: center;
    }

    .modal-buttons {
        flex-direction: column;
        gap: 10px;
    }
}
