/* Main App Layout */
body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    background-color: #f0f2f5;
    height: 100vh;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    width: 100vw;
    max-width: 100vw;
}

/* Sidebar Styles */
.sidebar {
    width: 250px;
    background-color: #343a40;
    border-right: 1px solid #495057;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    overflow: hidden;
}

.right-sidebar {
    position: fixed;
    top: 56px; /* Height of navbar */
    right: 0;
    width: 250px;
    height: calc(100vh - 56px);
    z-index: 990;
    background-color: #343a40;
    border-left: 1px solid #495057;
    box-shadow: -2px 0 12px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s, opacity 0.3s;
}

.right-sidebar.collapsed {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
}

.right-sidebar .sidebar-content {
    transition: opacity 0.3s ease;
}

.right-sidebar.collapsed .sidebar-content {
    opacity: 0;
    pointer-events: none;
}

.sidebar-header {
    padding: 12px 16px;
    border-bottom: 1px solid #495057;
    background-color: #212529;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.sidebar-header h5 {
    color: #f8f9fa;
    margin-bottom: 0;
}

.sidebar-content {
    padding: 15px 15px 0 15px;
    flex-grow: 1;
    color: #f8f9fa;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Dark sidebar form controls */
.sidebar .form-control, .sidebar .form-select, .sidebar .input-group-text {
    background-color: #212529;
    border-color: #495057;
    color: #f8f9fa;
}

.sidebar .form-control:focus, .sidebar .form-select:focus {
    background-color: #2c3136;
    color: #f8f9fa;
    border-color: #6c757d;
    box-shadow: 0 0 0 0.25rem rgba(130, 138, 145, 0.25);
}

.sidebar .form-control:disabled, .sidebar .form-select:disabled {
    background-color: #343a40;
    color: #adb5bd;
}

.sidebar .form-check-input {
    background-color: #212529;
    border-color: #6c757d;
}

.sidebar .form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.sidebar .form-check-label {
    color: #f8f9fa;
}

.sidebar .form-label {
    color: #e9ecef;
}

/* Sidebar button styles */
.sidebar .btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

.sidebar .btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

.sidebar .btn-outline-secondary {
    color: #e9ecef;
    border-color: #6c757d;
}

.sidebar .btn-outline-secondary:hover {
    background-color: #6c757d;
    color: #fff;
}

.sidebar .btn-outline-secondary.active {
    background-color: #6c757d;
    color: #fff;
}

.sidebar .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.sidebar .btn-danger, .sidebar .btn-outline-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

.sidebar .btn-danger:hover, .sidebar .btn-outline-danger:hover {
    background-color: #bb2d3b;
    border-color: #b02a37;
}

.sidebar .btn-outline-danger {
    background-color: transparent;
    color: #dc3545;
}

.sidebar .btn-outline-danger:hover {
    color: #fff;
}

/* Canvas Container */
.canvas-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    background-color: #f0f2f5;
    cursor: default;
    padding-bottom: 50px;
    width: 100vw;
    height: calc(100vh);
    max-width: 100vw;
    max-height: calc(100vh);
}

.canvas-workspace {
    flex: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    min-height: 0;
    min-width: 0;
    height: 100%;
}

.canvas-tools {
    background-color: #ffffff;
    padding: 10px 15px;
    border-top: 1px solid #dee2e6;
    display: none; /* Hidden by default, shown when floor plan is loaded */
    justify-content: flex-start;
    align-items: center;
    position: fixed; /* Change to fixed positioning */
    bottom: 0px; /* Position from bottom instead of using border-top */
    left: 250px; /* Account for left sidebar width */
    right: 0;
    width: auto;
    z-index: 1000; /* Ensure it appears above other elements */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15); /* More visible shadow */
    border-radius: 0px; /* Slightly larger rounded corners */
    transition: left 0.3s, right 0.3s; /* Smooth transition when sidebars change */
}

/* Make canvas tools responsive when sidebars are collapsed or hidden */
.left-sidebar[style*="display: none"] ~ .canvas-container .canvas-tools,
.left-sidebar:not([style*="display: flex"]) ~ .canvas-container .canvas-tools {
    left: 0;
}

#propertiesPane.collapsed ~ .canvas-container .canvas-tools,
.right-sidebar:not([style*="display: flex"]) ~ .canvas-container .canvas-tools {
    right: 0;
}

/* Hidden by default, shown when floor plan is loaded */
.left-sidebar {
    display: none;
}

/* Start Screen */
.start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f0f2f5;
    z-index: 10;
}

.start-screen-content {
    text-align: center;
    width: 600px;
    max-width: 90%;
    padding: 40px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.start-screen-content h2 {
    margin-bottom: 1rem;
    color: #333;
}

.start-screen-content .btn {
    padding: 0.75rem 1.5rem;
}

.start-screen-content .btn-lg {
    font-size: 1rem;
}

/* Game search and filters section */
.sidebar-search-filters {
    flex-shrink: 0;
    margin-bottom: 8px;
}

/* Sort controls - add more compact styling */
.game-sorts {
    margin-bottom: 6px !important;
    margin-top: 4px !important;
}

.game-sorts .col-form-label-sm {
    padding-top: 0;
    padding-bottom: 0;
    font-size: 12px;
}

.game-sorts .btn {
    padding: 1px 8px;
    font-size: 12px;
}

/* Game List */
.game-list {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 5px;
    padding-top: 0;
    padding-bottom: 15px;
    margin-right: -5px;
    margin-top: 0;
}

/* Game Selection List in Modal */
.game-selection-list {
    max-height: 300px;
    overflow-y: auto;
}

.game-selection-item {
    cursor: pointer;
    padding: 10px 12px;
    transition: background-color 0.2s;
    display: flex;
    flex-direction: column;
}

.game-selection-item:hover {
    background-color: #2c3136;
}

.game-selection-item.selected {
    background-color: #212529;
}

/* Game Item Styles (shared between library and selection) */
.game-item {
    padding: 6px 10px;
    border-bottom: 1px solid #495057;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    min-height: 60px;
    display: flex;
    flex-direction: column;
}

.game-item:hover {
    background-color: #2c3136;
    border-color: #495057;
}

.game-item.active {
    background-color: #212529;
    border-color: #495057;
}

.game-item-title {
    font-weight: 600;
    margin-bottom: 2px;
    font-size: 14px;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
    -webkit-hyphens: auto; /* Safari iOS < 17 */
    hyphens: auto;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #f8f9fa;
}

.game-item-dimensions {
    font-size: 12px;
    color: #adb5bd;
    margin-bottom: 2px;
    white-space: nowrap;
}

.game-item-type {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
    text-transform: capitalize;
    font-weight: 500;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: auto;
}

.game-type-ticket {
    background-color: var(--game-ticket-color, rgb(209, 231, 221));
}

.game-type-standard {
    background-color: var(--game-standard-color, rgb(207, 226, 255));
}

.game-type-prize {
    background-color: var(--game-prize-color, rgb(248, 215, 218));
}

.game-type-attraction {
    background-color: var(--game-attraction-color, rgb(255, 243, 205));
}

.game-type-non-game {
    background-color: var(--game-non-game-color, rgb(173, 216, 230));
}

/* Property Section */
.property-section {
    background-color: #2c3136;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.property-section h6 {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #495057;
    color: #f8f9fa;
}

/* Selected item info */
.selected-game-info p {
    color: #f8f9fa;
}

.selected-game-info #selectedGameName {
    color: #fff;
}

.selected-game-info #selectedGameType {
    color: #adb5bd;
}

/* Range inputs */
.sidebar .form-range::-webkit-slider-thumb {
    background-color: #0d6efd;
}

.sidebar .form-range::-moz-range-thumb {
    background-color: #0d6efd;
}

.sidebar .form-range::-webkit-slider-runnable-track {
    background-color: #495057;
}

.sidebar .form-range::-moz-range-track {
    background-color: #495057;
}

/* Badge for font size display */
.sidebar .badge.bg-secondary {
    background-color: #6c757d !important;
    color: #f8f9fa;
}

/* PDF Preview */
.pdf-preview-container {
    height: 550px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
}

.pdf-pages-list-container {
    max-height: 650px;
    overflow-y: auto;
    border-right: 1px solid #dee2e6;
}

.pdf-page-item {
    padding: 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.5rem;
}

.pdf-page-item.active {
    background-color: #e9ecef;
    border-color: #6c757d;
    box-shadow: 0 0 0 0.15rem rgba(108, 117, 125, 0.25);
}

.pdf-thumbnail-container {
    width: 100%;
    height: 0;
    padding-bottom: 70%;
    position: relative;
    margin-bottom: 0.5rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
}

.pdf-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pdf-page-label {
    font-size: 0.9rem;
    color: #495057;
    font-weight: 500;
}

.pdf-preview-image {
    max-width: 100%;
    max-height: 100%;
    transform-origin: 0 0;
}

.zoomable-preview {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAL0lEQVQ4jWP8//8/AzUBEwOVwaiBow1EKzDwf9SCI8NAFnrlaujlGLoZOBp1BhQAAJhML++CXU8WAAAAAElFTkSuQmCC');
}

.preview-zoom-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 8px 10px;
    border-radius: 6px;
    display: flex;
    gap: 8px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.preview-zoom-level {
    display: inline-block;
    min-width: 50px;
    text-align: center;
    padding: 6px 8px;
    margin-left: 8px;
    font-size: 14px;
    font-weight: bold;
    color: #495057;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.scale-preset {
    min-width: 80px;
    padding: 0.5rem 0.75rem;
    font-weight: 500;
}

.scale-preset.active {
    background-color: #0d6efd;
    color: white;
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.25);
}

/* Canvas Toolbar */
.canvas-toolbar {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 1000;
    background-color: white;
    padding: 4px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
}

.canvas-toolbar .btn-group {
    display: flex;
}

.canvas-toolbar .btn {
    width: 36px;
    height: 36px;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.canvas-toolbar .btn.active {
    background-color: #e9ecef;
    border-color: #ced4da;
    color: #0d6efd;
}

/* Measurement Tool */
.canvas-container.measure-mode {
    cursor: crosshair;
}

/* Tool cursors */
.cursor-measure {
    cursor: crosshair !important;
}

.cursor-pan {
    cursor: grab !important;
}

.cursor-select {
    cursor: default !important;
}

/* Modal Adjustment for z-index */
.modal-backdrop {
    z-index: 1500 !important;
}

.modal {
    z-index: 1550 !important;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 4px;
    background-color: #333;
    color: white;
    z-index: 9999;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success {
    background-color: #28a745;
}

.toast-error {
    background-color: #dc3545;
}

.toast-info {
    background-color: #17a2b8;
}

.toast-warning {
    background-color: #ffc107;
    color: #333;
}

/* Modal optimizations for PDF import */
.modal-fullscreen-xl-down {
    max-width: none;
    max-height: none;
    margin: 0;
}

.modal-fullscreen-xl-down .modal-content {
    height: auto;
}

.modal-fullscreen-xl-down .modal-body {
    padding: 1rem;
}

/* Custom sizing for PDF modal */
.modal-xl {
    max-width: 1350px;
}

/* Project delete button styling */
.delete-project {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.delete-project:hover {
    background-color: #dc3545;
    color: #fff;
}

/* Make project list items more interactive */
.list-group-item {
    padding: 0.75rem 1rem;
}

.project-link {
    text-decoration: none;
    color: inherit;
    padding: 0.25rem 0;
    display: block;
}

.project-link:hover {
    color: #0d6efd;
}

/* Quantity Input Group Styling */
.quantity-input-group {
    max-width: 150px; /* Limit the overall width */
}

.quantity-input-group .quantity-input {
    flex-grow: 0 !important; /* Prevent input from growing, override bootstrap */
    width: 50px !important; /* Set a fixed narrow width, override bootstrap */
    text-align: center; /* Center the number */
    /* Remove spinner buttons for browsers that might still show them on text inputs */
    -moz-appearance: textfield;
    appearance: textfield;
}

.quantity-input-group .quantity-input::-webkit-outer-spin-button,
.quantity-input-group .quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-input-group .btn {
    /* Optional: Adjust button padding if needed */
    /* padding: 0.375rem 0.5rem; */
    z-index: 1; /* Ensure buttons are clickable over input potentially */
}

/* Game filters styling */
.game-filters .btn-outline-secondary {
    background-color: transparent;
    border-color: #6c757d;
    color: #e9ecef;
    font-size: 12px;
    padding: 0.25rem 0.5rem;
}

.game-filters .btn-outline-secondary:hover {
    background-color: #6c757d;
    color: #fff;
}

.game-filters .btn-outline-secondary.active {
    background-color: #6c757d;
    color: #fff;
    border-color: #adb5bd;
}

/* Search box in sidebar */
.sidebar .input-group-text {
    background-color: #212529;
    border-color: #495057;
    color: #adb5bd;
}

/* Modal Content Fixes */
.modal .game-item-title {
    color: #212529;
}

.modal .game-item-dimensions {
    color: #6c757d;
}

.modal .game-item {
    border-bottom: 1px solid #dee2e6;
}

.modal .game-item:hover {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

.modal .game-item.active, 
.modal .game-selection-item.selected {
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.modal .game-selection-item:hover {
    background-color: #f8f9fa;
}

/* Make sure labels and text in modals are visible */
.modal label, 
.modal .form-label, 
.modal p,
.modal h5,
.modal h6 {
    color: #212529;
}

.modal .form-control,
.modal .form-select,
.modal .input-group-text {
    background-color: #fff;
    border-color: #ced4da;
    color: #212529;
}

.modal .form-control:focus,
.modal .form-select:focus {
    background-color: #fff;
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Prevent sidebar dark styles from affecting modals */
.modal .sidebar-content {
    color: #212529;
}

/* Ensure tab content has proper text color */
.nav-tabs .nav-link {
    color: #495057;
}

.nav-tabs .nav-link.active {
    color: #0d6efd;
}

/* Ensure game text is visible in available games lists */
.modal .game-selection-list {
    color: #212529;
}

/* Additional fixes for game items in sidebar */
.sidebar .game-item-title {
    color: #212529 !important;
    font-weight: 600 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    margin-bottom: 4px;
    flex: 0 0 auto; /* Prevent title from growing */
}

.sidebar .game-item-dimensions {
    color: #495057 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    margin-bottom: 4px;
    flex: 0 0 auto; /* Prevent dimensions from growing */
}

.sidebar .game-item-type {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.sidebar .game-list .game-item {
    background-color: #f8f9fa;
    margin-bottom: 4px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    width: calc(100% - 2px); /* Account for scrollbar width */
    box-sizing: border-box;
    overflow: hidden; /* Prevent content from spilling out */
    height: 75px; /* Increased height to allow for more spacing */
    min-height: 75px; 
    max-height: 75px; 
    display: flex;
    flex-direction: column;
    padding: 8px 10px 12px; /* Increased bottom padding */
}

.sidebar .game-list .game-item:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.sidebar .game-list .game-item.active {
    background-color: #dee2e6;
    border-color: #adb5bd;
}

.sidebar .game-list .game-item .game-item-type {
    font-size: 11px;
    padding: 1px 5px;
    border-radius: 3px;
    display: inline-block;
    text-transform: capitalize;
    font-weight: 500;
    max-width: calc(100% - 10px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 0; /* Reset margin-bottom */
}

/* Right sidebar properties wrapper */
.sidebar-properties-wrapper {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 5px;
    padding-bottom: 15px;
    margin-right: -5px;
}

.game-item-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding-bottom: 0; /* Remove bottom padding from container */
}

/* Add this new class to push the category label away from the title/dimensions */
.game-item-info > div:last-child {
    padding-top: 0; /* Reset padding to adjust spacing */
    margin-top: auto; /* Push to bottom */
}

.game-count-badge {
    font-size: 10px;
    padding: 2px 4px;
    height: auto;
    line-height: 1;
    vertical-align: middle;
}

.sidebar .game-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.game-bin-icon {
    position: absolute;
    top: 2px;
    right: 2px;
    color: #adb5bd;
    font-size: 14px;
    cursor: pointer;
    opacity: 0.7;
    z-index: 2;
    transition: color 0.15s, opacity 0.15s;
}

.game-bin-icon:hover {
    color: #dc3545;
    opacity: 1;
}

/* Games List Table Styles */
.sortable {
    cursor: pointer;
    position: relative;
    user-select: none;
}

.sortable:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.sort-icon {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 5px;
}

/* Only show sort icon for the actively sorted column */
.sort-asc .sort-icon::after,
.sort-desc .sort-icon::after {
    content: '';
    position: relative;
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
}

.sort-asc .sort-icon::after {
    border-bottom: 5px solid #666;
    top: -2px;
}

.sort-desc .sort-icon::after {
    border-top: 5px solid #666;
    top: 2px;
}

/* Excel export button styling */
#exportGamesListExcelBtn {
    background-color: #217346; /* Excel green */
    border-color: #217346;
}

#exportGamesListExcelBtn:hover {
    background-color: #1e6b3e;
    border-color: #1e6b3e;
}

/* Modal sizing for games list */
#gamesListModal .modal-xl {
    max-width: 95%;
}

/* Scrollable games list table styles */
#gamesListModal .modal-body {
    display: flex;
    flex-direction: column;
    max-height: 70vh;
}

#gamesListModal .form-check {
    flex-shrink: 0;
}

#gamesListModal .table-responsive {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#gamesListModal #gamesListTable {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#gamesListModal #gamesListTable thead,
#gamesListModal #gamesListTable tbody {
    display: block;
    width: 100%;
}

#gamesListModal #gamesListTable thead {
    flex-shrink: 0;
}

#gamesListModal #gamesListTable tbody {
    overflow-y: auto;
    max-height: calc(70vh - 120px);
}

#gamesListModal #gamesListTable thead tr,
#gamesListModal #gamesListTable tbody tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}

#gamesListModal #gamesListTable th,
#gamesListModal #gamesListTable td {
    width: 16.66%; /* 100% / 6 columns */
}

/* Adjust column widths for better content display */
#gamesListModal #gamesListTable th:nth-child(1),
#gamesListModal #gamesListTable td:nth-child(1) {
    width: 25%; /* Game Name gets more space */
}

#gamesListModal #gamesListTable th:nth-child(2),
#gamesListModal #gamesListTable td:nth-child(2),
#gamesListModal #gamesListTable th:nth-child(3),
#gamesListModal #gamesListTable td:nth-child(3) {
    width: 18%; /* Category and Manufacturer */
}

#gamesListModal #gamesListTable th:nth-child(4),
#gamesListModal #gamesListTable td:nth-child(4),
#gamesListModal #gamesListTable th:nth-child(5),
#gamesListModal #gamesListTable td:nth-child(5),
#gamesListModal #gamesListTable th:nth-child(6),
#gamesListModal #gamesListTable td:nth-child(6) {
    width: 13%; /* Width, Length, Quantity */
}

@media (max-width: 900px) {
    .right-sidebar {
        width: 90vw;
        min-width: 220px;
    }
}

/* Add styling for the game shape badge */
.game-shape-badge {
    display: inline-block;
    font-size: 0.75rem;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    color: #555;
}

/* Define specific shape badge colors */
.game-shape-Box {
    background-color: #f8f9fa;
}

.game-shape-Circle {
    background-color: #d1ecf1;
    color: #0c5460;
}

.game-shape-Hexagon {
    background-color: #d4edda;
    color: #155724;
}

.game-shape-Triangle {
    background-color: #fff3cd;
    color: #856404;
}

.game-shape-Oval {
    background-color: #f8d7da;
    color: #721c24;
}

.game-shape-Custom {
    background-color: #e2e3e5;
    color: #383d41;
}

/* Import Games Preview Table Styles */
#importGamesModal .modal-body {
    display: flex;
    flex-direction: column;
    max-height: 70vh;
}

#importGamesModal #gamesImportPreview {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#importGamesModal .table-responsive {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#importGamesModal #gamesPreviewTable {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#importGamesModal #gamesPreviewTable thead,
#importGamesModal #gamesPreviewTable tbody {
    display: block;
    width: 100%;
}

#importGamesModal #gamesPreviewTable thead {
    flex-shrink: 0;
}

#importGamesModal #gamesPreviewTable tbody {
    overflow-y: auto;
    max-height: calc(70vh - 150px);
}

#importGamesModal #gamesPreviewTable thead tr,
#importGamesModal #gamesPreviewTable tbody tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}

/* Import footer buttons area */
#importGamesModal .import-buttons {
    margin-top: 10px;
    flex-shrink: 0;
}

/* Dark theme for reporting chart */
#reportingModal .chart-container {
    background-color: #212529; /* Dark background */
    padding: 1rem;
    border-radius: 0.25rem;
}

/* Vertically center the chart within its container */
#reportingModal .chart-container div[style*="height: 300px"] {
    padding-top: 1.5rem; /* Add top padding to move chart down */
    display: flex;
    align-items: center;
    justify-content: center;
}

#reportingModal .chart-container #chartLegend {
    color: #f8f9fa; /* Light text color for legend */
}

#reportingModal .chart-container .legend-item span {
    color: #f8f9fa; /* Ensure legend text is light */
}

/* Chart loading spinner styles */
.chart-loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
}

/* Make the chart container position relative for proper spinner positioning */
.chart-container canvas {
    position: relative;
    z-index: 5;
}

/* Manufacturer stats container */
.manufacturer-stats {
    max-height: 280px; /* Increased from 250px */
    overflow-y: auto;
    padding: 0.5rem;
}

/* Make the Game Size Statistics card taller */
#reportingModal .card-body {
    padding: 1.25rem; /* Slightly increased padding for all cards */
}

/* Make the reporting modal dialog taller */
#reportingModal .modal-dialog {
    max-height: 90vh; /* Allow the modal to take up more vertical space */
}

#reportingModal .modal-body {
    padding-bottom: 1.5rem; /* Add more padding to bottom */
}

/* Give more vertical space to the Game Size Statistics card */
#reportingModal .card-body table.table-sm td {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}