html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Nested modal backdrop styling */
.nested-modal-backdrop {
    background-color: rgba(0, 0, 0, 0.4) !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

.nested-modal-backdrop.show {
    opacity: 1 !important;
}

/* Force modal dialogs above everything */
.modal {
    position: fixed !important;
}

/* Force new stacking context for all modals */
.modal {
    isolation: isolate !important;
}

/* Base z-index for first modal */
.modal.show {
    z-index: 1050 !important;
}

/* Force modal dialogs to create stacking context */
.modal.show .modal-dialog {
    position: relative !important;
    z-index: 1 !important;
    isolation: isolate !important;
    transform: translateZ(0) !important;
}

/* Force higher stacking for modals with inline z-index */
.modal[style*="z-index"] {
    isolation: isolate !important;
}

.modal[style*="z-index"] .modal-dialog {
    position: relative !important;
    z-index: 1 !important;
    isolation: isolate !important;
    transform: translateZ(0) !important;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0P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5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* Drag and Drop Styles */
.drop-zone {
    transition: background-color 0.2s ease, border-color 0.2s ease;
    position: relative;
}

.drop-zone.drag-over {
    background-color: #f8f9fa;
    border: 2px dashed #1b6ec2;
}

.drag-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(27, 110, 194, 0.1);
    border: 2px dashed #1b6ec2;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.drag-overlay-content {
    text-align: center;
    color: #1b6ec2;
    font-weight: 500;
}

.drag-overlay-content i {
    color: #1b6ec2;
}

/* Inspiration Card Styles */
.inspiration-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.inspiration-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* WordPress-style Tagging */
.tags-section {
    border-top: 1px solid #e9ecef;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
}

.tag-input-container {
    position: relative;
}

.tag-input-wrapper {
    min-height: 2.5rem;
    border: 1px solid #dee2e6 !important;
    border-radius: 0.375rem;
    padding: 0.5rem;
    cursor: text;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    background-color: #fff;
}

.tag-input-wrapper:focus-within {
    border-color: #86b7fe !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    outline: 0;
}

.tag-input-wrapper .badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.5rem;
    margin-bottom: 0.1rem;
    margin-right: 0.25rem;
    border-radius: 0.25rem;
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tag-input-wrapper .badge .btn-close {
    font-size: 0.5rem;
    width: 0.75rem;
    height: 0.75rem;
    margin-left: 0.25rem;
    flex-shrink: 0;
    opacity: 0.7;
}

.tag-input-wrapper .badge .btn-close:hover {
    opacity: 1;
}

.tag-text-input {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    font-size: 0.75rem;
    min-width: 100px;
    flex: 1;
    padding: 0;
    margin: 0;
}

.tag-text-input:focus {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.tag-suggestions-dropdown {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    max-height: 150px;
    overflow-y: auto;
    z-index: 1050;
    margin-top: 2px;
}

.tag-suggestion-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f8f9fa;
    transition: background-color 0.15s ease-in-out;
    display: flex;
    align-items: center;
}

.tag-suggestion-item:hover {
    background-color: #f8f9fa;
}

.tag-suggestion-item:last-child {
    border-bottom: none;
}

.tag-suggestion-item i {
    margin-right: 0.5rem;
    color: #6c757d;
}

/* Legacy tag styles for backward compatibility */
.tag-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    margin: 0.1rem;
    max-width: 100px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.tag-input {
    border: 1px solid #dee2e6;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.tag-input:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Modal backdrop for custom modals - replaces inline style="background-color: rgba(0,0,0,0.5)" */
.modal-backdrop-custom {
    background-color: rgba(0, 0, 0, 0.5);
}

/* Scene Tools Sidebar - Matches PhlankerWeb style */
.scene-tools-sidebar {
    width: 80px;
    display: flex;
    flex-direction: column;
    min-height: 300px;
}

/* Tool Icons Grid */
.tool-icons-grid {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
}

.tool-icon {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 0.5rem;
    transition: all 0.15s ease;
    position: relative;
}

.tool-icon i {
    font-size: 1.25rem;
}

.tool-icon span {
    font-size: 0.6rem;
    text-align: center;
    line-height: 1.1;
}

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

.tool-icon.active {
    background-color: rgba(13, 110, 253, 0.1);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .scene-tools-sidebar {
        width: 60px;
    }

    .tool-icon span {
        display: none;
    }

    .tool-icon {
        aspect-ratio: auto;
        padding: 0.5rem;
        margin-bottom: 0.25rem;
    }

    .tool-icon i {
        font-size: 1.1rem;
    }
}
