#gallery {
	width: 100%;
	padding-top: 20px;
	table-layout: fixed;
    border-collapse: separate;
	border-spacing: 0;
}

#gallery thead tr {
	background-color: #E8E7D0 !important;
	color: #894E50;
}

#gallery tr:nth-child(odd) {
	background-color: #fafaf0;
}

#gallery thead th, #gallery thead td {
    padding: 10px;
    border-bottom: 1px solid #111;
}

#gallery td {
	padding: 8px 10px;
}

#gallery td:nth-child(2), #gallery td:nth-child(3) {
	width: 36%;
}

#gallery tr td:nth-child(2) img, #gallery tr td:nth-child(3) img {
	border: 2px solid #E2CAE0;
}

#gallery img {
	max-width: 100% !important; /* Images fill their cells */
	height: auto; /* Maintain aspect ratio */
}

/* Apply word wrap to the first column */
#gallery td:first-child {
	overflow-wrap: break-word; 
}

#gallery th {
    position: relative; /* Allows absolute positioning within each th */
    vertical-align: middle; /* Aligns the content of all th elements */
    white-space: nowrap; /* Prevents wrapping and maintains consistent layout */
}

.sort-arrow {
    position: absolute; /* Positions arrows absolutely within th */
/*    right: 5px; /* Positions arrows to the right inside the header */
    top: 50%; /* Centers arrows vertically */
    transform: translateY(-50%); /* Adjusts for exact vertical centering */
    font-size: 0.75em; /* Arrow size */
    display: inline-block;
    vertical-align: middle; /* Aligns the sort arrow container with the text */
    margin-left: 8px; /* Spacing between header text and arrows */
    color: #b1b39d;
}

.sort-arrow span {
    display: block;
    line-height: 1; /* Reduces space between stacked arrows */
    text-align: center;
}

.sorted-asc span:first-child,
.sorted-desc span:last-child {
    color: #894E50;
}

@media (max-width: 450px) {
    #gallery thead th {
        text-align: center; /* Centers the text */
		vertical-align: top;
        padding-bottom: 15px; /* Ensures enough space for wrapped arrows */
        white-space: normal; /* Allows header text to wrap */
    }

    .sort-arrow {
        position: relative; /* Change to relative positioning */
        display: block; /* Ensures the entire arrow block can flow naturally */
        white-space: normal; /* Allows wrapping */
        margin-top: 5px; /* Adds a little space between the text and arrows */
        margin-left: auto; /* Centers the arrow block */
        margin-right: auto; /* Centers the arrow block */
    }

    .sort-arrow span {
        display: inline-block; /* Positions the arrows side-by-side */
        line-height: 1; /* Keeps the line height tight */
    }
}

@media (max-width: 350px) {
    #gallery thead th {
        font-size: smaller; /* Reduces the font size */
    }
	#gallery thead th, #gallery thead td {
		padding: 5px;
	}
}

#statistics-table {
	width: 100%;
}

#statistics-table td {
	padding: 10px;
}

#statistics-table tr:nth-child(odd) {
	background-color: #fafaf0;
}

#statistics-table tr td:first-child {
	width: 175px;
	font-weight: bold;
}
#statistics-table tr td:last-child {
	width: 50px;
	text-align: center;
	font-weight: bold;
}
#statistics-table thead tr {
	background-color: #E8E7D0 !important;
	color: #894E50;
	font-weight: bold;
}

#statistics-table .fill-bar {
	background-color: #a86c6e;
}

.statistics-top {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.stat-box {
    margin: 0;
    background-color: #fafaf0;
    text-align: center;
    min-height: 100px;
    padding: 20px 10px;
    border: 1px solid #E8E7D0;
    box-sizing: border-box;
}

.stat-box .stat-num {
	font-size: 36px;
}

.section-content {
    display: none; /* Initially hide the content */
}

.section-title {
    cursor: pointer;
}

.expand {
    float: right;
}

.section li {
	padding-top: 4px;
}

.section a {
	font-weight:bold;
}

.form-row {
    display: flex;
    align-items: flex-start; /* Align items to the top */
    margin-bottom: 15px;
    flex-wrap: wrap; /* Allow wrapping on small screens */
}
.form-row .label-tooltip label {
    font-weight: bold;
}
.disabled-label {
    color: #ccc; /* Grey color; adjust as needed */
}
.label-tooltip {
    display: flex;
    align-items: center;
    justify-content: flex-end; /* Right-align the contents */
    flex: 0 0 180px; /* Fixed width for label and icon */
    position: relative; /* Positioning context for tooltip */
    text-align: right;
    margin-right: 10px;
}

.input-container {
    flex: 1; /* Take up remaining space */
    min-width: 180px; /* Minimum width before wrapping */
    max-width: 300px; /* Maximum width for better appearance */
	width: 100%;
}

.input-container input,
.input-container select,
.input-container textarea {
    width: 100%; /* Ensures inputs take full width of their container */
    box-sizing: border-box; /* Includes padding and border in the element's total width */
}
.radio-option {
    margin-bottom: 10px;
}
.input-container input[type="radio"] {
    width: auto;
    margin-right: 8px;
    vertical-align: -2px;
    accent-color: #894E50;
}
.tooltip-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    background-color: #621217;
    color: white;
    border-radius: 50%;
    margin-left: 10px;
    cursor: pointer;
    font-size: 14px;
    position: relative;
}

.tooltip-content {
    display: none;
    position: absolute;
    top: 50%; /* Center vertically */
    left: 100%; /* Start right next to the icon */
    transform: translateY(-50%); /* Center align vertically with the icon */
    background-color: #f9f9f9;
    border: 1px solid #d4d4d4;
    color: black;
    padding: 5px 10px;
    z-index: 100; /* Ensure it's above other elements */
    width: 250px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3); /* More prominent shadow */
    white-space: normal;
    max-width: 90%;
	max-height: 200px;
    overflow-y: auto;
    text-align: left;
    font-size: 12px;
    font-style: italic;
}

.tooltip-icon:hover + .tooltip-content {
    display: block;
}

textarea {
    height: 100px;
}

input[type="submit"] {
    width: 100%; /* Full width of its container */
    max-width: 300px; /* Match with .input-container max-width */
    margin-left: auto; /* Center align the button */
    margin-right: auto; /* Center align the button */
    margin-top: 10px;
    padding: 10px 0; /* Add some vertical padding for a taller button */
    cursor: pointer;
}


.submitbutton {
    background-color: #e2cae0;
    -moz-border-radius: 6px;
    -webkit-border-radius: 6px;
    border-radius: 6px;
    border: 1px solid #638263;
    color: #404040 !important;
    font-family: Verdana;
    font-size: 16px;
    font-weight: normal !important;
    display: inline-block;
    text-decoration: none;
    text-align: center;
    box-sizing: border-box; /* Include padding and border in the button's dimensions */
    width: 100%; /* Full width of its container */
    max-width: 300px; /* Match with .input-container max-width */
    margin-left: auto; /* Center align the button */
    margin-right: auto; /* Center align the button */
    margin-top: 10px;
    padding: 10px 0; /* Add some vertical padding for a taller button */
    cursor: pointer;
}

.submitbutton:hover {
    background-color: #d5a7d2;
    color: #000000;
    cursor: pointer;
}


/* Adjustments for mobile screens */
@media (max-width: 450px) {
    .form-row {
        flex-direction: column; /* Stack label and input vertically */
        align-items: flex-start; /* Align items to the start (left) */
    }

    .label-tooltip {
        flex-basis: 100%;
        text-align: left; /* Left-align the label */
        margin-bottom: 10px; /* Add some space below the label line */
    }
    .tooltip-content {
        position: fixed; /* Fixed position relative to the viewport */
		left: 50%; /* Center horizontally */
        transform: translateX(-50%); /* Adjust only horizontal centering */
        bottom: auto; /* Reset bottom property */
        right: auto; /* Reset right property */
        width: 80%; /* Adjust the width as needed */
        max-width: none; /* Override any max-width */
		font-size: 14px; 
    }

    .input-container {
        flex-basis: 100%;
        width: 100%; /* Ensure full width for input containers */
    }

    input[type="submit"] {
        width: 100%; /* Full width on smaller screens */
        margin-left: 0; /* No left margin on smaller screens */
        margin-top: 10px;
    }
}

/* Specific style for checkboxes in .input-container */
.input-container input[type="checkbox"] {
    width: auto; /* Resets the width to the default for checkboxes */
    margin-right: 10px; /* Space between the checkbox and the label */
    flex-shrink: 0; /* Prevents the checkbox from shrinking */
}

/* Style for the container of checkbox and label */
.antler-checkbox-container {
    display: flex;
    align-items: center; /* Vertical alignment */
    margin-bottom: 5px; /* Space below each checkbox */
    flex-wrap: wrap; /* Allow wrapping */
}

/* Style for the checkbox */
.antler-checkbox-container input[type="checkbox"] {
    flex-shrink: 0; /* Prevent checkbox from shrinking */
    margin-right: 10px; /* Space between checkbox and label */
}

/* Style for the label of the checkbox */
.antler-checkbox-container label {
    flex-grow: 1; /* Allows the label to expand and take up available space */
    flex-basis: calc(100% - 30px); /* Adjust based on the width of the checkbox and margin */
    text-align: left; /* Aligns the text to the left */
    margin-top: 0; /* Ensures label aligns next to checkbox */
}


.gallery-sort {
    margin-bottom: 15px;
}

.sort-button {
    background-color: #e2cae0;
    border: 1px solid #638263;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    margin-left: 5px;
}

.sort-button.active,
.sort-button:hover {
    background-color: #d5a7d2;
}

.component-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, 220px);
    gap: 18px;
    justify-content: center;
}

.component-card {
    width: 220px;
    margin: 0 auto;
    background-color: #fafaf0;
    border: 1px solid #E8E7D0;
    padding: 10px;
    text-align: center;
    box-sizing: border-box;
    border-radius: 12px;
}

.component-card img.project-thumb {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}
.component-user {
    margin-top: 8px;
    font-weight: bold;
}

.piece-count-badge {
    display: inline-block;
    min-width: 24px;
    padding: 4px 3px;
    margin-left: 6px;
    border-radius: 7px;
    background-color: #894E50;
    color: #fff;
    font-weight: bold;
}

.award-icon {
    display: inline-block;
    width: 40px;
    text-align: center;
    vertical-align: middle;
	margin-right:5px;
}

.award-icon .piece-count-badge {
    margin-left: 0;
}

.award-row {
    margin-top: 5px;
}

.award-row img {
    width: 25px;
    height: 25px;
    margin: 0 3px;
    vertical-align: middle;
}

@media (max-width: 500px) {
    .component-gallery-grid {
        grid-template-columns: 1fr;
    }
}



.scene-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 230px));
    gap: 10px;
    justify-content: center;
    padding: 10px;
}

.scene-gallery-item {
    cursor: pointer;
    text-align: center;
}

.scene-gallery-item img {
    width: 100%;
    max-width: 230px;
    height: auto;
    border-radius: 12px;
    transition: transform 0.3s ease;
    box-sizing: border-box;
}

.scene-gallery-item:hover img {
    transform: scale(1.03);
}

.lightbox {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.65);
    z-index: 1000;
    padding: 20px;
    box-sizing: border-box;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 30px;
    color: white;
    cursor: pointer;
}

.lightbox-image {
    max-width: 90%;
    max-height: 70%;
    margin: auto;
    border: 5px solid white;
}

.lightbox-caption {
    color: white;
    text-align: center;
    margin-top: 15px;
    max-width: 90%;
}

.lightbox-nav {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 50px;
    transition: 0.6s ease;
    user-select: none;
    -webkit-user-select: none;
}

.lightbox-prev {
    left: 0;
}

.lightbox-next {
    right: 0;
}

@media screen and (max-width: 600px) {
    .lightbox-nav {
        top: auto;
        bottom: 60px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-caption {
        padding: 0 50px;
    }
}

.submission-choice-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 20px 0 30px;
}

.submission-choice {
    width: 300px;
    border: 2px solid #E8E7D0;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    box-sizing: border-box;
}

.submission-choice:hover {
    border-color: #894E50;
}

.submission-choice.selected {
    border-color: #894E50;
    background-color: #fafaf0;
}

.submission-choice img {
    width: 268px;
    height: 134px;
    object-fit: cover;
    display: block;
    margin: 0 auto 10px;
}

.submission-choice h4 {
    margin: 10px 0 5px;
}

.submission-choice p {
    margin: 0;
    font-size: 0.95em;
}

@media (max-width: 700px) {
    .submission-choice-container {
        flex-direction: column;
        align-items: center;
    }
}