body {
    font-family: 'Roboto','Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

h1,h2,h3,h4,h5,h6 {
    font-family: 'Panton','Roboto','Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.content {
    display: flex;
    width: 100%;
}

.tree-container {
    width: 30%;
    border-right: 1px solid #ccc;
    padding-right: 10px;
    overflow-y: auto;
    max-height: 100vh;
}

.tree-node {
    margin-left: 15px;
    margin-top: 5px;
    position: relative;
}

.tree-node-label {
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 5px;
    border-radius: 0px;
}

.tree-node-label.drag-over {
    background-color: #f0f0f0;
}

.tree-node-icon {
    margin-right: 5px;
    transition: transform 0.3s;
}

.tree-node-icon.collapsed {
    transform: rotate(0deg);
}

.tree-node-icon.expanded {
    transform: rotate(90deg);
}

.tree-node-children {
    display: none;
    margin-left: 15px;
}

/* Color coding based on type */
.type-Hall {
    color: #1f77b4;
    /* Blue */
}

.type-Section {
    color: #ff7f0e;
    /* Orange */
}

.type-Shelf {
    color: #d62728;
    /* Red */
}

.type-Vendor {
    color: #2ca02c;
    /* Green */
}

.type-empty {
    color: #000000;
    /* Purple */
}

#signInButton {
    padding: 10px;
    background-color: #106bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: large;
}

#signInButton:hover {
    background-color: #0b5dd7;
}

.details-container {
    width: 70%;
    padding-left: 20px;
    overflow-y: auto;
    max-height: 100vh;
    display: flex;
    align-items: flex-start; /* Align items at the start of the container */
}

.details {
    margin-top: 20px;
    width: 350px; /* Set the width of the details div */
    padding: 10px;
    box-sizing: border-box; /* Include padding in the element's total width and height */
}

.details h2 {
    margin-top: 0;
}

.details p {
    margin: 5px 0;
}

#layout-canvas {
    border: 1px solid #ccc; /* Optional: Add a border to the canvas for better visibility */
}


#progress-container {
    position: fixed; 
    bottom: 20px; 
    right: 20px; 
    z-index: 1000; 
    display: flex; 
    flex-direction: 
    column-reverse; gap: 10px;
}

.progress-message {
    font-size: 0.8em;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 5px;
    text-align: center;
    margin-bottom: 5px;
    z-index: 1000;
    display: inline-flex;
    justify-content: space-between;
    align-items: center;
    min-width: 200px;
    margin-top: 8px;
}

/* Progress ongoing style */
.progress-ongoing {
    background-color: #FF9800; /* Orange */
    color: white;
}

/* Done style */
.progress-done {
    background-color: #4CAF50; /* Green */
    color: white;
}

/* Error style */
.progress-error {
    background-color: #cf4242; /* Green */
    color: white;
}

/* Spinner (before) */
.progress-ongoing::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border: 3px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    margin-right: 10px;
    animation: spin 1s linear infinite;
}

/* Close button */
.progress-message button {
    background: transparent;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    margin-left: auto;
    padding-left: 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

#error-container {
    position: fixed;
    bottom: 50px; /* Adjust based on the height of the progress bar */
    right: 20px;
    z-index: 1000;
    width: 220px; /* Adjust width as needed */
}

.error-message {
    background-color: #cf4242; /* Red */
    color: white;
    font-size: 0.8em;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 5px;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.error-message button {
    background: none;
    border: none;
    color: white;
    font-size: 1em;
    cursor: pointer;
}

/* Style for the form container */
.new-child-form-container {
    max-width: 400px;
    margin: 10px auto;
    padding: 0px 20px 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f9f9f9;
}

/* Style for the form row */
.new-child-form-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

/* Style for labels */
.new-child-form-row label {
    flex: 1;
    margin-right: 10px;
    font-weight: bold;
}

/* Style for input fields */
.new-child-form-row input[type="text"],
.new-child-form-row input[type="number"] {
    flex: 2;
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

/* Style for the button */
.new-child-form-container button {
    width: 100%;
    padding: 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.new-child-form-container button:hover {
    background-color: #45a049;
}


/* QR scanning style */

#scanButton {
    background-color: #106bff;
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
}

#scanButton:hover {
    background-color: #0b5dd7;
}

#qr-reader {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 20;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: none;
}

#qr-success-feedback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 22;
    color: limegreen;
    font-size: 8rem;
    font-weight: bold;
}

.checkmark {
    animation: pop 0.5s ease;
}

@keyframes pop {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

#qr-cancel-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    z-index: 21;
}

.inventory-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    padding: 10px;
    margin: auto;
    font-family: 'Segoe UI', sans-serif;
}

.inventory-form input,
.inventory-form select {
    padding: 8px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    flex: 1;
}

.legacy-login summary {
    color: #666;
    cursor: pointer;
    font-size: 0.85rem;
}

.legacy-login form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.row-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.row-group > * {
    flex: 1;
    max-width: 100%;
}

.row-group button.small-button {
    flex: 0 0 auto; /* Don't stretch buttons */
    padding: 8px 12px;
    font-size: 14px;
    white-space: nowrap;
}

.row-group input,
.row-group select {
    flex: 1 1 auto;
    min-width: 0; /* prevent overflow */
}

.user-row > * {
    flex: unset;
}

.small-button {
    padding: 8px 12px;
    background-color: #106bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    font-weight: bold;
}

.small-button:hover {
    background-color: #0b5dd7;
}

.small-button:disabled {
    background-color: #ccc;
    cursor: default;
}

.submit-button {
    padding: 10px;
    background-color: #106bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    font-weight: bold;
}

.submit-button:hover {
    background-color: #0b5dd7;
}

.submit-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

select#searchDropdown, #targetObjectNameContainer {
    min-width: 160px; /* Prevent squashing */
}

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

.index-container h1 {
    font-size: 2.2rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    text-align: center;
}

.index-container .subtitle {
    text-align: center;
    color: #555;
    margin-bottom: 2rem;
}

.index-section {
    margin-top: 2rem;
}

.index-section h2 {
    font-size: 1.4rem;
    color: #34495e;
    margin-bottom: 0.5rem;
}

.link-buttons a {
    display: inline-block;
    margin: 5px 10px 10px 0;
    padding: 10px 14px;
    background-color: #106bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s ease-in-out;
}

.link-buttons a:hover {
    background-color: #0b5dd7;
}

.tool-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tool-list li {
    margin: 8px 0;
    font-size: 1rem;
}

.tool-list a {
    text-decoration: none;
    color: #106bff;
    font-weight: bold;
}

.tool-list a:hover {
    text-decoration: underline;
}

table.inventory-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 14px;
    background-color: white;
    border: 1px solid #ccc;
}

.inventory-table thead {
    background-color: #f0f2f5;
    text-align: left;
}

.inventory-table th, .inventory-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #e0e0e0;
}

.inventory-table th {
    font-weight: bold;
    color: #333;
}

.inventory-table tr:hover {
    background-color: #f9f9f9;
}

.inventory-table input[type="text"] {
    width: 100%;
    padding: 4px;
    font-size: 13px;
    box-sizing: border-box;
    margin-top: 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

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

.modal-content {
    position: relative;
    margin: 5vh auto;
    width: 90%;
    max-width: 1000px;
    height: 80vh;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    padding: 16px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: stretch;
}

.modal-content canvas {
    flex-grow: 1;
    width: 100%;
    height: 100%;
    background: #f0f0f0;
    display: block;
    border-radius: 4px;
}

.close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 1.5em;
    color: #333;
    cursor: pointer;
    z-index: 1000;
    font-weight: bold;
}

.photo-prev, .photo-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -22px;
    color: white;
    font-weight: bold;
    font-size: 28px;
    border-radius: 0 3px 3px 0;
    user-select: none;
    z-index: 999;
    background-color: rgba(0,0,0,0.4);
}
.photo-next {
    right: 0;
    border-radius: 3px 0 0 3px;
}
.photo-prev {
    left: 0;
}

table, table.inventory-table {
    width: 100%;
    border-collapse: collapse;
}
th, td, .inventory-table th, .inventory-table td {
    border: 1px solid #ddd;
    padding: 8px;
}
th, .inventory-table th {
    background-color: #f2f2f2;
}

/* Button variants */
.small-button.btn-danger {
    background-color: #f44336;
}

.small-button.btn-danger:hover {
    background-color: #da190b;
}

.small-button.btn-secondary {
    background-color: #2196F3;
}

.small-button.btn-secondary:hover {
    background-color: #0b7dda;
}

.submit-button.btn-warning {
    background-color: #FF9800;
}

.submit-button.btn-warning:hover {
    background-color: #e68900;
}

/* Django messages */
.messages {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.messages .message {
    padding: 12px 20px;
    margin-bottom: 10px;
    border-radius: 4px;
}

.messages .success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.messages .error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.messages .warning {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
}

/* List items with actions */
.item-list {
    list-style: none;
    padding: 0;
}

.item-list li {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.item-info {
    flex: 1;
}

.item-info h3 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 1.1rem;
}

.item-info p {
    margin: 3px 0;
    color: #666;
    font-size: 14px;
}

.item-actions {
    display: grid;
    gap: 8px;
    justify-items: stretch;
    align-items: flex-start;
    flex: 0 0 auto;
    min-width: 280px;
}

.import-run-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: start;
    width: 100%;
}

.import-filter-column {
    width: 100%;
}

.import-submit-button {
    width: 100%;
}

.delete-import-form {
    justify-self: end;
}

.delete-import-button {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 999px;
    background-color: transparent;
    color: #8b98a8;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.delete-import-button:hover {
    background-color: #fbeaea;
    color: #d33a2c;
}


.status-dropdown {
    position: relative;
    width: 100%;
}

.status-dropdown summary {
    list-style: none;
}

.status-dropdown summary::-webkit-details-marker {
    display: none;
}

.status-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid #d4dbe3;
    border-radius: 8px;
    background-color: #fff;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(16, 107, 255, 0.08);
}

.status-dropdown[open] .status-dropdown-trigger {
    border-color: #106bff;
    box-shadow: 0 0 0 3px rgba(16, 107, 255, 0.12);
}

.status-dropdown-summary {
    font-weight: bold;
    color: #3b4a5a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-dropdown-caret {
    color: #5f6f82;
    font-size: 12px;
}

.status-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 20;
    width: 100%;
    padding: 10px;
    border: 1px solid #d4dbe3;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 14px 28px rgba(34, 58, 84, 0.14);
}

.status-dropdown-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
}

.status-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 2px;
    border-radius: 8px;
    cursor: pointer;
}

.status-option input {
    margin: 0;
    width: 16px;
    height: 16px;
    accent-color: #106bff;
    flex: 0 0 auto;
}

.status-option-text {
    color: #2f3d4c;
    font-size: 14px;
}

.status-dropdown-empty {
    color: #76879a;
    font-size: 14px;
    padding: 4px 2px;
}

@media (max-width: 720px) {
    .item-list li {
        flex-direction: column;
    }

    .item-actions {
        width: 100%;
        min-width: 0;
    }

    .import-run-form {
        width: 100%;
    }

    .status-dropdown {
        width: 100%;
    }
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* Form groups for consistent form styling */
.form-group {
    margin-bottom: 15px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4CAF50;
}
