/* Maze Layout 3D Visualization Styles */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #1a1a2e;
    color: #e0e0e0;
    overflow: hidden;
    height: 100vh;
}

/* Main Container */
.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
.header {
    background: #16213e;
    padding: 12px 20px;
    border-bottom: 1px solid #0f3460;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.header h1 {
    font-size: 18px;
    font-weight: 600;
    color: #4CAF50;
    margin-bottom: 8px;
}

/* Controls */
.controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* Buttons */
button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

button:hover:not(:disabled) {
    filter: brightness(1.1);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.primary {
    background: #4CAF50;
    color: white;
}

.primary:hover:not(:disabled) {
    background: #45a049;
}

.secondary {
    background: #2196F3;
    color: white;
}

.secondary:hover:not(:disabled) {
    background: #1976D2;
}

.cancel-btn {
    background: #666;
    color: white;
}

.cancel-btn:hover:not(:disabled) {
    background: #555;
}

.download-btn {
    background: #9C27B0;
    color: white;
}

.download-btn:hover:not(:disabled) {
    background: #7B1FA2;
}

.compact-btn {
    padding: 6px 12px;
    font-size: 12px;
}

/* Pipeline Progress Indicator */
.pipeline-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

.pipeline-progress {
    display: flex;
    align-items: center;
    gap: 0;
}

.step-circle {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #3d4a5c;
    border: 2px solid #4a5568;
    transition: all 0.3s ease;
}

.step-circle.completed {
    background: #4CAF50;
    border-color: #4CAF50;
}

.step-circle.active {
    background: #2196F3;
    border-color: #2196F3;
    box-shadow: 0 0 6px rgba(33, 150, 243, 0.5);
}

.step-line {
    width: 24px;
    height: 2px;
    background: #4a5568;
    transition: background 0.3s ease;
}

.step-line.completed {
    background: #4CAF50;
}

.pipeline-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-btn {
    background: #2d3748;
    color: #e0e0e0;
    border: 1px solid #4a5568;
}

.dropdown-btn:hover {
    background: #3d4a5c;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #2d3748;
    min-width: 180px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    overflow: hidden;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 16px;
    background: transparent;
    color: #e0e0e0;
    border-radius: 0;
}

.dropdown-content button:hover {
    background: #4a5568;
}

.dropdown-right .dropdown-content {
    left: auto;
    right: 0;
}

/* Specific dropdown button styles */
.tiles-btn {
    background: #4CAF50 !important;
    color: white !important;
    border: none !important;
}

.props-btn {
    background: #FF9800 !important;
    color: white !important;
    border: none !important;
}

.rooms-btn {
    background: #9C27B0 !important;
    color: white !important;
    border: none !important;
}

/* Toolbar divider */
.toolbar-divider {
    width: 1px;
    height: 28px;
    background: #4a5568;
    margin: 0 8px;
}

/* Instructions Panel */
.instructions {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 11px;
    line-height: 1.5;
    color: #a0a0a0;
}

.instructions strong {
    color: #e0e0e0;
}

/* Interior View Controls Panel */
.interior-controls {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(30, 30, 46, 0.95);
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid #4CAF50;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    z-index: 100;
}

.interior-controls-title {
    font-weight: 600;
    color: #4CAF50;
    font-size: 14px;
    padding-right: 8px;
    border-right: 1px solid #444;
}

/* Mode Panel */
.mode-panel {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(22, 33, 62, 0.95);
    border-radius: 8px;
    border: 1px solid #0f3460;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    z-index: 100;
    overflow: hidden;
}

.mode-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-right: 1px solid #0f3460;
}

.mode-tab {
    padding: 10px 16px;
    background: transparent;
    border: none;
    color: #888;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.mode-tab:hover {
    color: #e0e0e0;
    background: rgba(255, 255, 255, 0.05);
}

.mode-tab.active {
    color: #4CAF50;
    background: rgba(76, 175, 80, 0.15);
}

.mode-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
}

.toggle-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: #e0e0e0;
    font-size: 13px;
    user-select: none;
}

.toggle-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #4CAF50;
    cursor: pointer;
}

.toggle-checkbox:hover {
    color: #fff;
}

.interior-exit-btn {
    background: #c62828;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-left: 8px;
}

.interior-exit-btn:hover {
    background: #e53935;
}

/* File Input Hidden */
.file-input-hidden {
    display: none;
}

/* Canvas Container */
#canvas-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#canvas-container canvas {
    display: block;
}

/* Modal Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

/* Modal */
.modal {
    background: #1e1e2e;
    border-radius: 12px;
    padding: 24px;
    min-width: 400px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal h2 {
    margin-bottom: 20px;
    color: #4CAF50;
    font-size: 20px;
}

.modal h3 {
    margin-bottom: 12px;
    color: #e0e0e0;
    font-size: 16px;
}

/* Modal Tabs */
.modal-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 2px solid #333;
    padding-bottom: 0;
}

.modal-tab {
    padding: 10px 20px;
    background: transparent;
    color: #888;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-tab:hover {
    color: #e0e0e0;
}

.modal-tab.active {
    color: #4CAF50;
    border-bottom-color: #4CAF50;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Modal Actions */
.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #333;
}

/* Setup Sections */
.setup-section {
    margin-bottom: 20px;
    padding: 16px;
    background: #1e1e2e;
    border-radius: 8px;
    border: 1px solid #333;
}

.setup-section h3 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #e0e0e0;
}

.setup-info-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #1a3a5c;
    border: 1px solid #2196F3;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #90CAF9;
}

.setup-info-box .info-icon {
    font-size: 16px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* Range slider styling */
input[type="range"] {
    width: 100%;
    height: 6px;
    background: #4a5568;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #4CAF50;
    border-radius: 50%;
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #4CAF50;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Form Groups */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #b0b0b0;
    font-size: 13px;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    background: #2d3748;
    border: 1px solid #4a5568;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4CAF50;
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: #666;
    font-size: 11px;
}

/* Tile Weights Section */
.tile-weights-section {
    margin-bottom: 20px;
}

.tile-weights-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Tile Groups */
.tile-group {
    background: #252535;
    border-radius: 8px;
    overflow: hidden;
}

.tile-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #2d3748;
    cursor: pointer;
    transition: background 0.2s;
}

.tile-group-header:hover {
    background: #3d4a5c;
}

.tile-group-icon {
    font-size: 18px;
    margin-right: 8px;
}

.tile-group-title {
    font-weight: 500;
    color: #e0e0e0;
}

.tile-group-count {
    color: #666;
    font-size: 12px;
    margin-left: 8px;
}

.tile-group-total {
    color: #4CAF50;
    font-size: 13px;
    font-weight: 500;
    margin-left: auto;
}

.tile-group-expand-icon {
    font-size: 10px;
    color: #888;
    transition: transform 0.2s;
}

.tile-group:not(.expanded) .tile-group-expand-icon {
    transform: rotate(-90deg);
}

.tile-items {
    padding: 12px 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.tile-group.expanded .tile-items {
    display: grid;
}

.tile-group:not(.expanded) .tile-items {
    display: none;
}

.tile-item {
    display: flex;
    flex-direction: column;
    padding: 14px;
    background: #1e1e2e;
    border-radius: 8px;
    border: 1px solid #333;
    transition: border-color 0.2s, background 0.2s;
    min-width: 0;
    overflow: hidden;
}

.tile-item:hover {
    border-color: #555;
    background: #252535;
}

.tile-item.disabled {
    opacity: 0.5;
    border-color: #2a2a3a;
}

.tile-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 8px;
}

.tile-item-name {
    color: #e0e0e0;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.tile-item-value {
    color: #4CAF50;
    font-size: 14px;
    font-weight: 600;
    min-width: 30px;
    text-align: right;
    flex-shrink: 0;
}

.tile-meta {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: #666;
    margin-top: 10px;
    flex-wrap: wrap;
}

.tile-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Tile Slider */
.tile-slider-container {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.tile-slider {
    flex: 1;
    min-width: 60px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #4a5568;
    border-radius: 3px;
    cursor: pointer;
}

.tile-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--slider-color, #4CAF50);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.tile-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--slider-color, #4CAF50);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.tile-slider.zero::-webkit-slider-thumb {
    background: #666;
}

.tile-slider.zero::-moz-range-thumb {
    background: #666;
}

/* Quick Buttons */
.tile-quick-btns {
    display: flex;
    gap: 4px;
}

.tile-quick-btn {
    padding: 4px 8px;
    font-size: 11px;
    background: #3d4a5c;
    border: none;
    border-radius: 4px;
    color: #b0b0b0;
    cursor: pointer;
}

.tile-quick-btn:hover {
    background: #4a5568;
    color: #e0e0e0;
}

/* Preset Buttons */
.preset-buttons {
    display: flex;
    gap: 8px;
}

.preset-btn {
    padding: 6px 12px;
    font-size: 12px;
    background: #3d4a5c;
    border: 1px solid #4a5568;
    border-radius: 4px;
    color: #b0b0b0;
    cursor: pointer;
}

.preset-btn:hover {
    background: #4a5568;
    color: #e0e0e0;
    border-color: #5a6678;
}

/* Distribution Preview */
.distribution-preview {
    margin-top: 16px;
    padding: 16px;
    background: #252535;
    border-radius: 8px;
}

.distribution-bar {
    height: 24px;
    display: flex;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.distribution-segment {
    height: 100%;
    transition: width 0.3s ease;
}

.distribution-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.distribution-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #b0b0b0;
}

.distribution-label-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

/* Settings Info */
.settings-info {
    background: #252535;
    padding: 12px 16px;
    border-radius: 8px;
    color: #888;
    font-size: 13px;
    line-height: 1.6;
}

/* Legend */
.legend {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 8px;
    max-width: 200px;
    z-index: 10;
    font-size: 12px;
}

.legend strong {
    color: #e0e0e0;
    margin-top: 8px;
}

.legend strong:first-child {
    margin-top: 0;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #b0b0b0;
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* Info Panel */
.info {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    color: #e0e0e0;
    z-index: 10;
}

/* Instructions Panel - positioned in canvas */
#canvas-container .instructions {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 3000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 20px;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #333;
    border-top-color: #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: #e0e0e0;
    font-size: 16px;
}

/* Tile Preview Dialog */
.tile-preview-search {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.tile-preview-search input {
    flex: 1;
    padding: 10px 14px;
    background: #2d3748;
    border: 1px solid #4a5568;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 14px;
}

.tile-preview-search input:focus {
    outline: none;
    border-color: #4CAF50;
}

.tile-preview-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 4px;
}

.tile-preview-card {
    background: #252535;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.tile-preview-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.tile-preview-canvas-container {
    width: 100%;
    height: 180px;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tile-preview-canvas-container canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.tile-preview-card canvas {
    width: 100%;
    height: 150px;
    display: block;
}

.tile-preview-card .tile-info {
    padding: 12px;
}

.tile-preview-card .tile-name {
    font-weight: 500;
    color: #e0e0e0;
    margin-bottom: 4px;
}

.tile-preview-card .tile-details {
    font-size: 11px;
    color: #888;
}

/* Tile Preview Controls and Info */
.tile-preview-controls {
    display: flex;
    gap: 4px;
    padding: 4px 8px;
    background: #1a1a2a;
    border-top: 1px solid #333;
}

.tile-preview-btn {
    padding: 4px 8px;
    background: #333;
    border: none;
    border-radius: 4px;
    color: #ccc;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.tile-preview-btn:hover {
    background: #444;
}

.tile-preview-info {
    padding: 12px;
}

.tile-preview-name {
    font-weight: 500;
    color: #e0e0e0;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.tile-preview-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tile-preview-detail {
    font-size: 11px;
    color: #888;
}

.tile-preview-detail-value {
    color: #aaa;
    font-weight: 500;
}

.tile-preview-connectors {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #333;
}

.tile-preview-connectors-title {
    font-size: 10px;
    color: #666;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.tile-preview-connector-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.tile-preview-connector-badge {
    padding: 2px 6px;
    background: #2a5a2a;
    border-radius: 3px;
    font-size: 10px;
    color: #8f8;
    font-weight: 500;
}

.tile-tag {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
}

.tile-tag.main-exit {
    background: #5a4a2a;
    color: #ffd700;
}

.tile-tag.transition {
    background: #4a3a2a;
    color: #ff9800;
}

/* Tile Fullview */
.tile-fullview-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 4000;
}

.tile-fullview-overlay.active {
    display: block;
}

.tile-fullview-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

.tile-fullview-content {
    flex: 1;
    display: flex;
    flex-direction: row;
    min-height: 0;
}

.tile-fullview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: #1e1e2e;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
}

.tile-fullview-title {
    font-size: 18px;
    font-weight: 600;
    color: #4CAF50;
}

.tile-fullview-close {
    padding: 8px 16px;
    background: #666;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.tile-fullview-close:hover {
    background: #555;
}

.tile-fullview-canvas {
    flex: 1;
    position: relative;
    min-width: 0;
    background: #0a0a15;
}

.tile-fullview-canvas canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.tile-fullview-hint {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    color: #888;
    pointer-events: none;
}

.tile-fullview-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(30, 30, 46, 0.95);
    border-top: 1px solid #333;
}

.tile-fullview-control-btn {
    padding: 8px 16px;
    background: #2d3748;
    color: #b0b0b0;
    border: 1px solid #4a5568;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
}

.tile-fullview-control-btn:hover {
    background: #3d4a5c;
    color: #e0e0e0;
}

.tile-fullview-control-btn.active {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

/* Tile Fullview Sidebar */
.tile-fullview-sidebar {
    width: 320px;
    background: #1e1e2e;
    border-left: 1px solid #333;
    padding: 20px;
    overflow-y: auto;
    flex-shrink: 0;
}

.tile-fullview-section {
    margin-bottom: 24px;
}

.tile-fullview-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #4CAF50;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #333;
}

.tile-fullview-property {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #2a2a3a;
}

.tile-fullview-property:last-child {
    border-bottom: none;
}

.tile-fullview-property-label {
    color: #888;
    font-size: 13px;
}

.tile-fullview-property-value {
    color: #e0e0e0;
    font-size: 13px;
    font-weight: 500;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a2e;
}

::-webkit-scrollbar-thumb {
    background: #4a5568;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5a6678;
}

/* Props Preview Specific */
.props-preview-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 4px;
}

.prop-preview-card {
    background: #252535;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.prop-preview-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.prop-preview-card canvas {
    width: 100%;
    height: 120px;
    display: block;
    background: #1a1a2e;
}

.prop-preview-card .prop-info {
    padding: 10px;
}

.prop-preview-card .prop-name {
    font-weight: 500;
    color: #e0e0e0;
    font-size: 13px;
    margin-bottom: 4px;
}

.prop-preview-card .prop-details {
    font-size: 10px;
    color: #888;
}

/* Rooms Preview Specific */
.rooms-preview-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 4px;
}

.room-preview-card {
    background: linear-gradient(145deg, #252535, #1e1e2e);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid #333;
}

.room-preview-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
    border-color: #4CAF50;
}

.room-preview-card .room-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
}

.room-preview-card .room-icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

/* SVG icons for each theme */
.room-preview-card .room-icon::before {
    content: '';
    width: 24px;
    height: 24px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

/* Industrial - gear icon */
.room-preview-card .room-icon.theme-industrial::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 15.5A3.5 3.5 0 0 1 8.5 12 3.5 3.5 0 0 1 12 8.5a3.5 3.5 0 0 1 3.5 3.5 3.5 3.5 0 0 1-3.5 3.5m7.43-2.53c.04-.32.07-.64.07-.97 0-.33-.03-.66-.07-1l2.11-1.63c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.31-.61-.22l-2.49 1c-.52-.39-1.06-.73-1.69-.98l-.37-2.65A.506.506 0 0 0 14 2h-4c-.25 0-.46.18-.5.42l-.37 2.65c-.63.25-1.17.59-1.69.98l-2.49-1c-.22-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64L4.57 11c-.04.34-.07.67-.07 1 0 .33.03.65.07.97l-2.11 1.66c-.19.15-.25.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1.01c.52.4 1.06.74 1.69.99l.37 2.65c.04.24.25.42.5.42h4c.25 0 .46-.18.5-.42l.37-2.65c.63-.26 1.17-.59 1.69-.99l2.49 1.01c.22.08.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.66Z'/%3E%3C/svg%3E");
}

/* Storage - box icon */
.room-preview-card .room-icon.theme-storage::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M21 16.5c0 .38-.21.71-.53.88l-7.9 4.44c-.16.12-.36.18-.57.18-.21 0-.41-.06-.57-.18l-7.9-4.44A.991.991 0 0 1 3 16.5v-9c0-.38.21-.71.53-.88l7.9-4.44c.16-.12.36-.18.57-.18.21 0 .41.06.57.18l7.9 4.44c.32.17.53.5.53.88v9M12 4.15L6.04 7.5 12 10.85l5.96-3.35L12 4.15M5 15.91l6 3.38v-6.71L5 9.21v6.7m14 0v-6.7l-6 3.37v6.71l6-3.38Z'/%3E%3C/svg%3E");
}

/* Office - desk/briefcase icon */
.room-preview-card .room-icon.theme-office::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M20 6h-4V4c0-1.11-.89-2-2-2h-4c-1.11 0-2 .89-2 2v2H4c-1.11 0-2 .89-2 2v11c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2m-6 0h-4V4h4v2Z'/%3E%3C/svg%3E");
}

/* Machine Room - cpu/processor icon */
.room-preview-card .room-icon.theme-machine::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M6 4h12v2h-12V4m0 14h12v2h-12v-2m-2-2h2v-8H4v8m14 0h2v-8h-2v8m-6-6h4v4h-4v-4m-4 1h2v2H8v-2m8 0h2v2h-2v-2M6 8h12v8H6V8Z'/%3E%3C/svg%3E");
}

/* Control Room - sliders icon */
.room-preview-card .room-icon.theme-control::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M7 3v2H3v2h4v2h2V3H7m4 0v6h2V7h4V5h-4V3h-2m-4 8v2H3v2h4v2h2v-6H7m4 0v2h8v-2h-8m-4 6v6h2v-2h4v-2H9v-2H7m4 2v2h8v-2h-8Z'/%3E%3C/svg%3E");
}

/* Dining Hall - utensils icon */
.room-preview-card .room-icon.theme-dining::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M11 9H9V2H7v7H5V2H3v7c0 2.12 1.66 3.84 3.75 3.97V22h2.5v-9.03C11.34 12.84 13 11.12 13 9V2h-2v7m5-3v8h2.5v8H21V2c-2.76 0-5 2.24-5 4Z'/%3E%3C/svg%3E");
}

/* Maintenance - wrench icon */
.room-preview-card .room-icon.theme-maintenance::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M22.7 19l-9.1-9.1c.9-2.3.4-5-1.5-6.9-2-2-5-2.4-7.4-1.3L9 6 6 9 1.6 4.7C.4 7.1.9 10.1 2.9 12.1c1.9 1.9 4.6 2.4 6.9 1.5l9.1 9.1c.4.4 1 .4 1.4 0l2.3-2.3c.5-.4.5-1.1.1-1.4Z'/%3E%3C/svg%3E");
}

/* Default - room/home icon */
.room-preview-card .room-icon.theme-default::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M19 9.3V4h-3v2.6L12 3 2 12h3v8h5v-6h4v6h5v-8h3l-3-2.7m-9 .7c0-1.1.9-2 2-2s2 .9 2 2h-4Z'/%3E%3C/svg%3E");
}

.room-preview-card .room-icon.theme-industrial { background: linear-gradient(135deg, #FF9800, #E65100); }
.room-preview-card .room-icon.theme-storage { background: linear-gradient(135deg, #8D6E63, #5D4037); }
.room-preview-card .room-icon.theme-office { background: linear-gradient(135deg, #42A5F5, #1565C0); }
.room-preview-card .room-icon.theme-machine { background: linear-gradient(135deg, #78909C, #455A64); }
.room-preview-card .room-icon.theme-control { background: linear-gradient(135deg, #AB47BC, #7B1FA2); }
.room-preview-card .room-icon.theme-dining { background: linear-gradient(135deg, #9CCC65, #558B2F); }
.room-preview-card .room-icon.theme-maintenance { background: linear-gradient(135deg, #A1887F, #6D4C41); }
.room-preview-card .room-icon.theme-default { background: linear-gradient(135deg, #26A69A, #00796B); }

.room-preview-card .room-card-info {
    flex: 1;
    min-width: 0;
}

.room-preview-card .room-card-title {
    font-weight: 600;
    color: #fff;
    font-size: 14px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.room-preview-card .room-card-subtitle {
    font-size: 12px;
    color: #888;
}

.room-preview-card .room-card-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 0 16px 14px 16px;
}

.room-preview-card .room-badge {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.room-preview-card .room-badge.props {
    background: #4CAF50;
    color: #fff;
}

.room-preview-card .room-badge.theme {
    background: #333;
    color: #aaa;
    border: 1px solid #444;
}

.room-preview-card .room-badge.variation {
    background: #2196F3;
    color: #fff;
}

/* Room preview filters bar */
.rooms-filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
    padding: 12px 16px;
    background: #1a1a2e;
    border-radius: 8px;
}

.rooms-filter-bar select {
    padding: 8px 14px;
    background: #2d3748;
    color: #fff;
    border: 1px solid #4a5568;
    border-radius: 6px;
    font-size: 13px;
    min-width: 140px;
}

.rooms-filter-bar select:focus {
    outline: none;
    border-color: #4CAF50;
}

.rooms-filter-bar .rooms-count {
    color: #4CAF50;
    font-size: 13px;
    font-weight: 500;
    margin-left: auto;
}

/* Generate Rooms Dialog */
.generate-rooms-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tiles-zones-list {
    max-height: 240px;
    overflow-y: auto;
    background: #1a1a2e;
    border-radius: 10px;
    border: 1px solid #333;
}

/* Simple tile list (no checkboxes) */
.tiles-zones-simple-list {
    max-height: 180px;
    overflow-y: auto;
    background: #1a1a2e;
    border-radius: 8px;
    border: 1px solid #333;
    padding: 4px;
}

.tile-zone-simple-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-radius: 4px;
}

.tile-zone-simple-item:nth-child(odd) {
    background: rgba(255, 255, 255, 0.02);
}

.tile-zone-simple-name {
    color: #e0e0e0;
    font-size: 13px;
}

.tile-zone-simple-count {
    color: #888;
    font-size: 11px;
}

.tile-zone-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid #2a2a3a;
    transition: background 0.15s;
    cursor: pointer;
}

.tile-zone-item:last-child {
    border-bottom: none;
}

.tile-zone-item:hover {
    background: #252535;
}

.tile-zone-item input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #555;
    border-radius: 4px;
    background: #1a1a2e;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: all 0.15s;
}

.tile-zone-item input[type="checkbox"]:checked {
    background: #4CAF50;
    border-color: #4CAF50;
}

.tile-zone-item input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.tile-zone-item .tile-zone-check {
    display: none;
}

.tile-zone-item .tile-zone-info {
    flex: 1;
    min-width: 0;
}

.tile-zone-item .tile-zone-name {
    font-weight: 500;
    color: #e0e0e0;
    font-size: 13px;
    margin-bottom: 5px;
}

.tile-zone-item .tile-zone-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tile-zone-item .zone-badge {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    background: #333;
    color: #888;
}

.tile-zone-item .zone-badge.prop { background: #4CAF5033; color: #4CAF50; }
.tile-zone-item .zone-badge.light { background: #FFC10733; color: #FFC107; }
.tile-zone-item .zone-badge.loot { background: #9C27B033; color: #9C27B0; }
.tile-zone-item .zone-badge.trap { background: #F4433633; color: #F44336; }

.tiles-zones-empty {
    color: #F44336;
    padding: 20px;
    text-align: center;
}

/* Generate rooms settings row */
.generate-settings-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.generate-settings-row .form-group {
    margin-bottom: 0;
}

/* Generate status box */
.generate-status {
    display: flex;
    align-items: center;
    margin-top: 16px;
    padding: 16px;
    background: #1a1a2e;
    border-radius: 10px;
    border: 1px solid #333;
}

.generate-status.loading {
    border-color: #2196F3;
    background: #2196F311;
}

.generate-status.loading .status-icon {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.generate-status.success {
    border-color: #4CAF50;
    background: #4CAF5011;
}

.generate-status.success .status-text {
    color: #4CAF50;
}

.generate-status.error {
    border-color: #F44336;
    background: #F4433611;
}

.generate-status.error .status-text {
    color: #F44336;
}

.generate-status .status-icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.generate-status .status-spinner {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    border: 2px solid #333;
    border-top-color: #2196F3;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.generate-status.success .status-icon {
    background: #4CAF50;
    position: relative;
}

.generate-status.success .status-icon::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 3px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.generate-status.error .status-icon {
    background: #F44336;
    position: relative;
}

.generate-status.error .status-icon::before,
.generate-status.error .status-icon::after {
    content: '';
    position: absolute;
    left: 9px;
    top: 4px;
    width: 2px;
    height: 12px;
    background: white;
}

.generate-status.error .status-icon::before {
    transform: rotate(45deg);
}

.generate-status.error .status-icon::after {
    transform: rotate(-45deg);
}

.generate-status .status-text {
    color: #888;
    font-size: 14px;
}

/* Empty state */
.rooms-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.rooms-empty-state .empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    border-radius: 16px;
    background: linear-gradient(135deg, #333, #222);
    border: 2px dashed #444;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rooms-empty-state .empty-icon::before {
    content: '';
    width: 32px;
    height: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23555'%3E%3Cpath d='M19 9.3V4h-3v2.6L12 3 2 12h3v8h5v-6h4v6h5v-8h3l-3-2.7m-9 .7c0-1.1.9-2 2-2s2 .9 2 2h-4Z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.rooms-empty-state .empty-title {
    font-size: 16px;
    color: #888;
    margin-bottom: 8px;
}

.rooms-empty-state .empty-subtitle {
    font-size: 13px;
    color: #666;
}
