/* Styles for the QB Gen part of the page design.html */

/* House Preview Container */
#house-preview-container {
    position: relative;
    overflow: hidden;
    background-color: var(--bg-tertiary);
    border: 2px solid var(--border-secondary);
    box-sizing: border-box;
    padding: 0.5rem;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: 1 / 1;
}

/* Use Flexbox to Center Content */
.sticky-preview {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.shadow {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* SVG Element */
#house-preview-container svg {
    width: auto;
    height: auto;
}

/* Make the house preview sticky on large screens */
@media (min-width: var(--screen-xl)) { 
    .sticky-preview {
        position: sticky;
        top: var(--top-bar-height);
        flex: 1;
        display: flex;
        flex-direction: column;
    }
    #input-bar-container {
        max-height: calc(100vh - var(--top-bar-height));
        overflow-y: auto;
    }
    .my-wide-container {
        height: calc(100vh - var(--top-bar-height));
    }
}

/* Add mobile-specific styles */
@media (max-width: calc(var(--screen-xl) - 1px)) {
    #house-preview-container {
        min-height: 300px;
        max-height: 600px;
    }
}

/* Smooth transitions for collapsing sections */
#input-bar-content,
#room-sizes-content {
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
    overflow: hidden;
}

/* Optional: Enhance the visibility of toggle buttons */
#toggle-input-bar,
#toggle-room-sizes {
    cursor: pointer;
}

/* Adjust the toggle icon rotation when active */
.rotate-180 {
    transform: rotate(180deg);
}

/* Update warning message styles */
#warning-message {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    transition: opacity 0.3s ease-in-out;
    max-width: 100%;
    margin: 0;
}

/* Top Bar Styling */
#top-bar {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-secondary);
}

/* Warning Message */
#warning-message {
    background-color: var(--warning);
    border-left: 4px solid color-mix(in srgb, var(--warning) 70%, black);
    color: var(--text-primary);
}

/* Input Bar Container */
#input-bar-container {
    background-color: var(--bg-secondary);
}

/* Toggle Buttons */
#toggle-input-bar,
#toggle-room-sizes {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-secondary);
    color: var(--text-primary);
}
#toggle-input-bar:hover,
#toggle-room-sizes:hover {
    background-color: color-mix(in srgb, var(--bg-secondary) 90%, black);
}

/* Form Elements */
.uk-select,
.uk-input {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    color: var(--text-secondary);
}
.uk-select:focus,
.uk-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 20%, transparent);
}

/* Range Sliders */
input[type="range"] {
    accent-color: var(--primary);
}

/* Text Colors */
.text-gray-500 {
    color: var(--text-secondary);
}
.font-semibold,
.font-bold {
    color: var(--text-primary);
}

/* SVG Icons */
.text-gray-500 svg {
    color: var(--text-secondary);
}

/* Location Section */
#location-address {
    color: var(--text-secondary);
}

/* Room Sizes Content */
#room-sizes-content {
    background-color: var(--bg-primary);
}

/* Help Text */
.uk-form-help {
    color: var(--text-tertiary);
}

/* Sticky Preview */
.sticky-preview {
    background-color: var(--bg-primary);
}

/* Shadow Utility */
.shadow {
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

/* Dimensions Display */
#dimensions-value,
#total-area-value,
#estimated-cost-value {
    color: var(--text-primary);
}

/* Labels */
label {
    color: var(--text-secondary);
}

/* Section Headers */
h3.text-lg {
    color: var(--text-primary);
}

/* Room Size Labels */
.relative span {
    color: var(--text-secondary);
}

/* Add this to ensure the main container uses cream color */
.my-wide-container {
    height: calc(100vh - var(--top-bar-height));
    max-width: 100vw;
    width: 100%;
    margin: 0 auto;
    background-color: var(--bg-primary);
}

/* Ensure the body of this specific page uses cream color */
body {
    background-color: var(--bg-primary);
}

/* Add this to your style section */
.flex-grow {
    background-color: var(--bg-primary);
}

/* Update the input bar container */
#input-bar-container {
    background-color: var(--bg-primary);
}

/* Update the toggle button */
#toggle-input-bar {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-secondary);
}

/* Update the main container */
.my-wide-container {
    background-color: var(--bg-primary);
}

/* Update the shadow class */
.shadow {
    background-color: var(--bg-primary);
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

/* Update the sticky preview */
.sticky-preview {
    background-color: var(--bg-primary);
}

/* Update the form content area */
#input-bar-content {
    background-color: var(--bg-primary);
}

/* Custom scrollbar styling */
.custom-scrollbar {
    overflow-y: auto; /* Ensure vertical scrollbar appears when needed */
    margin: 12px 0; /* Add vertical margin to create space around scrollbar */
    scrollbar-width: thin;  /* For Firefox */
    scrollbar-color: rgba(0, 0, 0, 0.3) transparent;  /* For Firefox */
}
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;  /* Width of the scrollbar */
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;  /* Track background */
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.3);  /* Scrollbar color */
    border-radius: 3px;  /* Rounded corners */
}

/* AI mode specific styling */
#ai-mode {
    height: 100%;
    display: block; /* Visible by default */
}

/* Manual mode hidden by default; toggled via JS */
#manual-mode.hidden {
    display: none;
}
#ai-mode.hidden {
    display: none;
}

/* Remove all existing tab styles first */
.uk-tab-alt {
    margin: 0;
    padding: 0;
    list-style: none;
    width: 100%;
}

.uk-tab-alt li {
    margin: 0;
}

.uk-tab-alt li a {
    position: relative;
    display: block;
    text-decoration: none;
    color: #6B7280; /* text-gray-500 */
    font-weight: normal;
}

/* Active state styling - exactly matching mobile tabs */
.uk-tab-alt li.uk-active a {
    color: var(--primary, #477674);
    font-weight: 500;
}

/* Bottom border indicator */
.uk-tab-alt li.uk-active a::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary, #477674);
}

/* Remove all hover states */
.uk-tab-alt li a:hover {
    color: #6B7280;
}

/* Markdown content styling */
.markdown-content {
    line-height: 1.4;
    word-wrap: break-word;
    word-break: normal;
    white-space: normal !important;
}
.markdown-content p {
    margin-bottom: 0.5em;
    white-space: normal !important;
}
.markdown-content p:last-child {
    margin-bottom: 0;
}
.markdown-content code {
    background-color: rgba(0,0,0,0.05);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: monospace;
}
.markdown-content pre {
    background-color: rgba(0,0,0,0.05);
    padding: 0.75em;
    border-radius: 5px;
    overflow-x: auto;
    margin: 0.5em 0;
}
.markdown-content pre code {
    background-color: transparent;
    padding: 0;
}
.markdown-content ul, .markdown-content ol {
    margin-bottom: 0.5em;
    padding-left: 1.5em;
}
.markdown-content h1, .markdown-content h2, .markdown-content h3, 
.markdown-content h4, .markdown-content h5, .markdown-content h6 {
    margin-top: 1em;
    margin-bottom: 0.3em;
    font-weight: 600;
}
.markdown-content a {
    color: #2563eb;
    text-decoration: underline;
}
.markdown-content blockquote {
    border-left: 4px solid #e5e7eb;
    padding-left: 1em;
    margin-left: 0;
    margin-right: 0;
    font-style: italic;
}

/* Let grid items shrink properly and avoid text overlap */
#top-bar .grid > div {
  min-width: 0;
}

/* Update top bar positioning */
#top-bar {
  position: sticky;
  top: 0;
  z-index: 10;
}

/* Update warning message positioning to account for top bar */
#warning-message {
  top: var(--top-bar-height);
}






/* Top bar responsive padding - override default */
#top-bar > div > div {
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: var(--screen-sm)) {
    #top-bar > div > div {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: var(--screen-lg)) {
    #top-bar > div > div {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}




/* Update the grid layout for better mobile responsiveness */
#top-bar .grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
    width: 100%;
    max-width: 100%;
}

@media (min-width: var(--screen-sm)) {
    #top-bar .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: var(--screen-md)) {
    #top-bar .grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Center align items in the top bar */
#top-bar .flex.items-center {
    justify-content: center;
    text-align: center;
}

/* Update the top bar content alignment */
#top-bar .grid > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Center the icons and text */
#top-bar .flex.items-center.gap-2 {
    justify-content: center;
}

/* Adjust button container on mobile */
#top-bar .flex.justify-end {
    justify-content: center;
    margin-top: 1rem;
}

@media (min-width: var(--screen-md)) {
    #top-bar .flex.justify-end {
        justify-content: flex-end;
        margin-top: 0;
    }
}

/* Center align the cost breakdown button */
#top-bar .flex.items-center.justify-center {
    width: 100%;
}

/* Make the buttons full width on mobile */
@media (max-width: calc(var(--screen-sm) - 1px)) {
    #top-bar .uk-button {
        width: 100%;
        margin: 0.25rem 0;
    }
    
    #top-bar .flex.justify-end {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    #top-bar .flex.justify-end .uk-button {
        width: 100%;
    }
}

/* Update the main container padding for mobile */
.my-wide-container {
    padding: 1rem;
}

@media (min-width: var(--screen-sm)) {
    .my-wide-container {
        padding: 2rem;
    }
}

/* Update container styles for mobile */
@media (max-width: calc(var(--screen-xl) - 1px)) {
    .my-wide-container {
        min-height: 0;
        height: auto;
    }
    
    #house-preview-container {
        min-height: 300px; /* Minimum height on mobile */
        height: calc(100vw - 2rem); /* Make it responsive to screen width */
        max-height: 600px; /* Maximum height on mobile */
    }
}

/* Update desktop styles */
@media (min-width: var(--screen-xl)) {
    .sticky-preview {
        position: sticky;
        top: var(--top-bar-height);
        height: calc(100vh - var(--top-bar-height) - 2rem);
        display: flex;
        flex-direction: column;
    }
    
    .my-wide-container {
        height: calc(100vh - var(--top-bar-height));
    }
    
    #house-preview-container {
        flex: 1;
        min-height: 0;
    }
}

/* Mobile tab styling */
@media (max-width: calc(var(--screen-xl) - 1px)) {
    #configuration-panel {
        display: none; /* Initially hide on mobile, JS will show it */
    }

    #preview-panel {
        display: block; /* Show preview by default on mobile */
    }
    
    #mobile-content-tabs li a {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    #mobile-content-tabs li a svg {
        width: 1rem;
        height: 1rem;
        margin-right: 0.375rem;
    }
}

/* Mobile-only tabs visibility - Now primarily controlled by JS adding/removing parent class */
/* Default state for mobile (when desktop-view-active is NOT present) */
#mobile-content-tabs {
    display: flex;
}

/* When desktop view is active, hide mobile tabs */
.desktop-view-active #mobile-content-tabs {
    display: none !important;
}


/* Ensure proper display on desktop panels (config and preview) */
@media (min-width: var(--screen-xl)) {
    #configuration-panel {
        display: flex !important;
        flex-direction: column;
    }
    
    #preview-panel {
        display: block !important;
    }
    
    /* Redundant due to JS and .desktop-view-active, but kept for clarity or as fallback */
    /* #mobile-content-tabs {
        display: none !important;
    } */
}

/* Top bar layout improvements */
#top-bar .min-w-0 {
    min-width: 0;
}

#top-bar .truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#top-bar .whitespace-nowrap {
    white-space: nowrap;
}

#top-bar .uk-button-small {
    padding: 0.25rem 0.75rem;
    min-height: 0;
    line-height: 1.5;
}

/* Remove conflicting grid styles */
#top-bar .grid {
    width: 100%;
    max-width: 100%;
}

/* Mobile optimizations */
@media (max-width: calc(var(--screen-sm) - 1px)) {
    #top-bar .flex-grow {
        flex-grow: 1;
    }
    
    #top-bar .ml-2 {
        margin-left: 0.5rem;
    }
    
    #top-bar .gap-1 {
        gap: 0.25rem;
    }

    /* Make mobile tabs smaller on mobile */
    #mobile-content-tabs li a {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    #mobile-content-tabs li a svg {
        width: 1rem;
        height: 1rem;
        margin-right: 0.375rem;
    }

    .uk-modal-container .uk-modal-dialog {
        height: auto !important;
        max-height: 95vh !important;
    }
  
    #gallery-modal-image-container {
        min-height: 40vh !important;
    }
}

/* Desktop optimizations */
@media (min-width: var(--screen-sm)) {
    #top-bar .sm\:gap-2 {
        gap: 0.5rem;
    }
    
    #top-bar .sm\:ml-4 {
        margin-left: 1rem;
    }
}

/* Ensure parent of absolute positioned button is relative */
#preview-panel .shadow {
    position: relative; /* Needed for uk-position-absolute on the button */
}

/* Gallery button styling - reduce padding */
.uk-position-absolute[uk-toggle="target: #gallery-modal"] {
    padding: 6px !important;
}

.uk-position-absolute[uk-toggle="target: #gallery-modal"] svg {
    width: 1.25rem;
    height: 1.25rem;
}
  /* Force UIkit to respect fixed height */
  .uk-modal-container .uk-modal-dialog {
    height: 70vh !important;
    max-height: 70vh !important;
    transform: none !important;
  }
  
  /* Prevent content size from influencing container */
  #gallery-modal-image-container {
    height: calc(100% - 40px) !important;
    min-height: calc(100% - 40px) !important;
  }

.markdown-content blockquote {
    border-left: 4px solid #e5e7eb;
    padding-left: 1em;
    margin-left: 0;
    margin-right: 0;
    font-style: italic;
}

.uk-modal-dialog {
    background-color: var(--bg-primary); /* Ensure modals have an opaque background */
}

/* Let grid items shrink properly and avoid text overlap */
#top-bar .grid > div {
  min-width: 0;
}

@media (min-width: var(--screen-md)) {
    #top-bar .flex.justify-end {
        justify-content: flex-end;
        margin-top: 0;
    }
}











/* Styles for the IFC part of the page design.html */

.test-viewer-wrapper { 
    min-height: 70vh; 
    background-color: #f8f9fa;
    display: flex; /* Use flex to manage child */
    flex-direction: column;
    padding: 0 !important; /* Remove padding that might shrink viewer area */
}

#viewer-container-test {
    width: 100% !important;
    height: 70vh !important; /* Changed to viewport height with !important */
    min-height: 300px !important; /* Keep minimum for usability with !important */
    overflow: hidden; /* Prevent canvas from expanding this container */
    position: relative; /* Good for positioning internal canvas */
}

.viewer-controls {
    margin-top: 15px;
    padding: 15px;
    background-color: #f0f8ff;
    border-radius: 5px;
    border-left: 4px solid #007acc;
}
.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}
.status-ready { background-color: #28a745; }
.status-loading { background-color: #ffc107; }
.status-error { background-color: #dc3545; }
.status-inactive { background-color: #6c757d; }

.model-info {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #e8f4fd;
    border-radius: 5px;
    border-left: 4px solid #007acc;
}

.performance-info {
    margin-top: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 3px;
    font-size: 12px;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.test-tabs {
    margin-bottom: 20px;
}

.tab-button {
    padding: 8px 16px;
    margin-right: 10px;
    background-color: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-button.active {
    background-color: #007acc;
    color: white;
    border-color: #007acc;
}

.tab-button:hover:not(.active) {
    background-color: #dee2e6;
}







/* Below is the CSS for the "Generate House" button on the page design.html */
