/* PCB Map Generation Page Styles */

/* Ensure the main layout container allows scrolling */
.unified-layout {
    height: auto;
    min-height: 100vh;
    overflow: visible;
    display: flex;
    flex-direction: column;
}

.unified-content {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
    flex: 1;
    /* Allow to grow */
}

/* --- Top Configuration Panel --- */
.input-panel {
    width: 100%;
    max-width: none;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #dee2e6;
    flex: 0 0 auto;
    position: relative;
    background-color: #f8f9fa;
    z-index: 10;
    overflow: visible;
}

/* Apply Grid ONLY to the Input Panel content */
.input-panel .panel-content {
    display: grid;
    /* Reduced min-width to 200px to avoid premature wrapping on standard laptops */
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
    /* Reduced gap to save horizontal space */
    padding: 0.5rem;
    width: 100%;
    box-sizing: border-box;
}

.input-section {
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    padding: 1rem;
    background: white;
    height: 100%;
    width: auto;
    max-width: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.input-section:last-child {
    border-right: 1px solid #dee2e6;
}

/* Ensure internal form elements don't overflow, but exclude checkboxes */
.input-section input:not([type="checkbox"]):not([type="radio"]),
.input-section select {
    width: 100%;
}

/* --- Bottom Results/Map Panel --- */
.results-panel {
    display: flex;
    flex-direction: column;
    /* Stack tabs and content vertically */
    height: auto;
    aspect-ratio: 4/3;
    min-height: 400px;
    flex: 1 1 auto;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* Reset layout for Results Panel content */
.results-panel .panel-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: 0;
    /* Remove padding to let map hit edges if desired, or keep small padding */
    grid-template-columns: none;
    /* Cancel grid */
    gap: 0;
}

.results-tabs {
    padding-left: 1rem;
    /* Re-add padding for tabs alignment if needed */
    padding-top: 0.5rem;
    background-color: white;
    border-bottom: 1px solid #dee2e6;
}

.tab-content.results-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

/* Apply flex layout to active tab panes to ensure full height */
.tab-content.results-content > .tab-pane.active {
    display: flex !important;
    flex-direction: column;
    flex: 1;
    height: 100%;
    width: 100%;
}

.tab-header {
    padding: 0.5rem 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.tab-body {
    flex: 1;
    position: relative;
    height: 100%;
    width: 100%;
    padding: 0;
}

/* Responsive adjustment for map container */
.map-container-unified {
    width: 100% !important;
    height: 100% !important;
    min-height: 500px;
}

/* Panel Active/Inactive States */
.panel-inactive {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(100%);
    user-select: none;
    cursor: not-allowed;
}

.project-locked {
    opacity: 0.45;
    pointer-events: none;
    filter: grayscale(100%);
    user-select: none;
    cursor: not-allowed;
}

.project-readonly-locked {
    opacity: 0.6;
    pointer-events: none;
    filter: grayscale(85%);
    user-select: none;
    cursor: not-allowed;
}

.status-message-container {
    padding: 0.75rem 1.25rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
    margin-bottom: 1rem;
}

/* --- Relief Sidebar --- */
.relief-sidebar {
    width: 320px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* --- Relief Status Overlay (bottom of map) --- */
.relief-status-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    padding: 5px;
    font-size: 11px;
    border-top: 1px solid #ddd;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
}
