/* General Body Styles */
body {
    font-family: Arial, sans-serif;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f0f0f0;
}

.logo {
    position: relative;
    top: -10px;
    left: -10px;
    height: auto;
    width: auto;
    max-height: 100px;
    max-width: 75%;
}

/* Container Styles */
.container {
    position: relative;
    overflow: hidden;
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    min-height: max(500px, 60vh);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: height 0.5s ease-in-out;
}

.container.settings-open {
    height: 100vh;
    max-height: 100vh;
    max-height: min(800px, 100vh);
    overflow-y: auto;
}

/* Mobile Styles */
@media (max-width: 767px) {
    body {
        padding: 0;
    }

    .container {
        border-radius: 0;
    }
}

/* Header Styles */
h1 {
    color: #333;
    text-align: center;
    font-size: 24px;
}

.header {
    display: flex;
    align-items: center;
}

.header.keep-visible {
    z-index: 3000;
    position: relative;
}

/* Input Styles */
.input-group {
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
}

.input-field {
    width: 48%;
}

label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-size: 18px;
}

input, .regular-button {
    width: 100%;
    padding: 10px;
    font-size: 18px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

/* Button Styles */
button.regular-button {
    background-color: #4c9daf;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s, opacity 0.3s;
}

button.regular-button:hover {
    background-color: #457aa0;
}

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

#chooseRandomButton {
    font-size: 22px;
    padding: 30px;
    margin-bottom: 20px;
    margin-top: 20px;
    max-width: 400px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

#fullReset {
    background-color: #f44336;
}

#fullReset:hover {
    background-color: #d32f2f;
}

@keyframes Shimmer {
    0% {background-position: 0% 50%;}
    50% {background-position: 100% 50%;}
    100% {background-position: 0% 50%;}
}

.shimmer {
    background-size: 200% 200%;
    animation: Shimmer 3s ease infinite;
    transition: all 0.5s ease;
}

.blue-shimmer {
    background: linear-gradient(45deg, #2a5c69, #4c9daf, #176d82);
    box-shadow: 0 0 15px #4c9daf;
    text-shadow: 0 0 2px #000;
    color: #FFF;
    transition: all 0.5s ease;
}

.golden-shimmer {
    background: linear-gradient(45deg, #FFD700, #FFA500, #FFD700);
    box-shadow: 0 0 15px #FFD700;
    text-shadow: 0 0 2px #000;
    color: #FFF;
    transition: all 0.5s ease;
}

.text-shimmer {
    background: linear-gradient(45deg, #2a5c69, #4c9daf, #176d82);
    color: transparent;
    text-shadow: 0 0 15px #4c9daf;
    background-clip: text;
}

/* Result Display Styles */
.result {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e9e9e9;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    font-size: 20px;
    text-align: center;
    height: 70px;
}

#result {
    font-weight: bold;
    color: #4c9daf;
    font-size: 48px;
    font-family: 'Courier New', Courier, monospace;
}

/* Progress Bar Styles */
.progress-bar-container {
    width: 100%;
    background-color: #ddd;
    height: 20px;
    border-radius: 10px;
    margin-top: 20px;
    overflow: hidden;
    transition: all 0.5s;
}

#progress-bar {
    width: 0%;
    height: 100%;
    background-color: #4c9daf;
    border-radius: 10px;
    transition: all 0.5s;
}

/* Congratulations Message Styles */
#congrats-message {
    text-align: center;
    margin-top: 20px;
    animation: fadeIn 2s;
}

/* Utility Classes */
.hidden {
    display: none;
}

/* Brand Styles */
.brand {
    text-align: center;
    color: #777;
    font-style: italic;
    font-family: "Courier New", monospace;
    margin-top: 20px;
}

.brand a {
    color: #777;
    text-decoration: none;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.result.highlight {
    animation: highlightFade 3.0s forwards;
}

@keyframes highlightFade {
    0% {
        box-shadow: 0 0 20px #4c9daf;
        background-color: rgba(0, 187, 255, 0.1);
    }
    100% {
        box-shadow: none;
        background-color: #e9e9e9;
    }
}

/* Media Queries */
@media (min-width: 768px) {
    #reset {
        margin-left: auto;
        margin-right: 0;
    }
}

/* Settings */
.settings-container {
    position: absolute;
    top: 10px;
    right: 10px;
}

.settings-toggle {
    position: absolute;
    top: 10px;
    right: 20px;
    background: none;
    border: none;
    font-size: 36px;
    cursor: pointer;
    z-index: 1002; /* Ensure it's above the settings panel */
}

.settings-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
    min-width: 200px;
}

h3 {
    margin-top: 0;
}

.settings-panel {
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    transition: top 0.3s ease-in-out;
    z-index: 1000;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.settings-panel.open {
    top: 0;
}

.close-settings {
    margin-top: 20px;
    padding: 10px 20px;
    max-width: 100px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.setting-item {
    margin-bottom: 15px;
}

.setting-item label {
    display: block;
    margin-bottom: 5px;
}

.settings-content {
    flex-grow: 1;
}

.hidden {
    display: none;
}

.icon-button {
    background: none;
    border: none;
    font-size: 36px;
    cursor: pointer;
    padding: 5px;
    width: auto; /* Override any width set for general buttons */
    display: inline; /* Override any display properties set for general buttons */
}

.icon-button:hover {
    /* Hover styles for the icon button, if needed */
    opacity: 0.8;
}

.settings-content {
    display: flex;
    flex-direction: column;
}

.setting-section {
    background-color: #f5f5f5;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.input-group input[type="number"] {
    flex-grow: 1;
    font-size: 16px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.add-button, .save-button {
    background-color: #4c9daf;
    color: white;
    border: none;
    padding: 10px 15px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 4px;
}

.tag-container, .tag-builder {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.tag {
    background-color: #e0e0e0;
    padding: 5px 10px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    font-size: 14px;
    transition: all 0.3s;
}

.tag .tag-remove {
    margin-left: 5px;
    cursor: pointer;
    font-weight: bold;
    color: #666;
}

.save-button {
    margin-top: 10px;
    align-self: flex-start;
}

.info-icon {
    font-size: 0.8em;
    color: #007bff;
    cursor: pointer;
    margin-left: 5px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 5000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 5px;
}

.share-modal {
    position: fixed;
    z-index: 5000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.share-modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 5px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

/* Section control */

.section-display {
    display: flex;
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 10px;
}

.section-column {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 40px;
    border-right: 1px solid #fff;
    font-size: 14px;
    box-sizing: border-box;
    color: #333;
    transition: all 0.3s ease;
    cursor: pointer;
}

.section-column:hover {
    filter: brightness(90%);
}

.section-column:last-child {
    border-right: none;
}
.reset-button {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 10px 15px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 4px;
    margin-top: 10px;
}

#debugContainer {
    margin-top: 20px;
    border: 1px solid #ccc;
    padding: 10px;
    background-color: #f9f9f9;
}

#debugInfo {
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 12px;
    margin-top: 10px;
}

/* input error */
.input-error {
    border: 2px solid red !important;
}

.conflicting-tag {
    background-color: #ff6666 !important;
    border: 2px solid #ff0000 !important;
    box-shadow: 0 0 5px #ff0000 !important;
    transition: all 0.3s ease;
}

.starting-buttons {
    display: flex;
    justify-content: space-around;
}

.big-button {
    padding: 20px;
    margin-top: 20px;
    margin-bottom: 20px;
    min-height: 100px;
    font-size: 18px;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    background-color: #4c9daf;
    color: white;
    transition: background-color 0.3s;
    max-width: 40%;
}

.big-button:hover {
    background-color: #1c5f6e;
}

#mainSectionContainer {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#chooseOwnMeasures {
    margin-bottom: 10px;
    max-width: 200px;
    width: 100%;
}

.section-column {
    transition: background-color 0.1s ease;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    transition: opacity 0.3s ease-in-out;
    z-index: 2000;
    padding: 60px;
    padding-top: 35%;
    padding-bottom: 25%;
    box-sizing: border-box;
    overflow-y: auto;
    display: none;
    flex-direction: column;
    opacity: 0;
    justify-content: space-between;
}

@media (max-width: 767px) {
    .overlay {
        padding-left: 5%;
        padding-right: 5%;
    }
}

.overlay.active {
    display: flex;
    opacity: 1;
}

.modal-buttons {
    margin-top: 20px;
    display: flex;
    flex-direction: row;
    gap: 20px;
}

.close-modal-button {
    background-color: darkred;
}

.piece-box {
    border: 1px solid #d3d3d3;  
    border-radius: 5px; 
    padding: 10px; 
    align-items: center;
    margin-top: 20px;
    background-size: 200% 200%;
    animation: Shimmer 3s ease infinite;
    transition: all 0.5s ease;
    background: linear-gradient(45deg, rgba(42, 92, 105, 0.0), rgba(76, 157, 175, 0.0), rgba(23, 109, 130, 0.0));
    color: #000000;
    transition: all 0.5s ease;
}

.piece-box-content {
    display: flex;
    flex-direction: row;
    gap: 20px;
    align-items: center;
    opacity: 100%;
}

.piece-box-content h3 {
    margin: 0;
    display: flex;
    align-items: center;
    height: 100%;
    position: relative;
}

.piece-button {
    box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.3);
    border: 1px solid lightgrey;
    background-color: white;
    color: black;
    opacity: 0.9;
    font-size: 90%;
    cursor: pointer;
    transition: background-color 0.3s, opacity 0.3s, box-shadow 0.3s;
    border-radius: 5px;
    padding: 7px;
}

.piece-button:hover {
    opacity: 1;
    box-shadow: inset 0px 0px 5px rgba(0, 0, 0, 0.1);
}

.delete-confirmation {
    display: flex;
    flex-direction: row;
    gap: 20px;
    align-items: center;
}

.delete-button {
    background-color: #ff4d4d;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    height: 40px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.delete-button:hover {
    background-color: #ff1a1a;
}

.piece-box-content > *:nth-child(1) {
    flex-basis: 90%;
}

.piece-box-content > *:nth-child(2) {
    flex-basis: 10%;
}

#setupNewPieceButton {
    margin-top: 20px;
}

.collapsible {
    height: 0;
    overflow: hidden;
    transition: height 0.3s ease-out;
}

.collapsible-headline {
    margin-bottom: 0;
}

.collapsible.open {
    height: auto;
    overflow: visible;
}

.collapsible-button {
    width: 100%;
    margin-bottom: 20px;
    background-color: #f5f5f5;
    border-radius: 8px;
    padding: 15px;
    font-size: inherit;
    text-align: left;
    border: none;
}

.collapsible-headline::after {
    content: "\002B";
    font-weight: bold;
    float: right;
    margin-right: 5px;
}

.collapsible-headline.active::after {
    content: "\2212";
}