/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Sortable.js styling */
.sortable-ghost {
  opacity: 0.4;
}

/* Sortable.js styling */
.sortable-chosen {
  opacity: 0.8;
}

/* Sortable.js styling */
.sortable-drag {
  opacity: 0.8;
}

/* Sortable.js styling */
.sortable-ghost .feature-item,
.sortable-ghost .door-item {
  background-color: #374151 !important;
  border: 2px dashed #6B7280;
}

/* Sortable.js styling */
.sortable-chosen .feature-item,
.sortable-chosen .door-item {
  transform: scale(1.02);
  z-index: 10;
}

/* Sortable.js styling */
.sortable-drag .feature-item,
.sortable-drag .door-item {
  transform: rotate(5deg);
}

/* Delete button styling */
.w-4.h-4 {
  font-size: 10px;
  line-height: 1;
}

/* Dynamic height scaling for features */
.feature-item {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* Dynamic height scaling for features */
.feature-header {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

body {
    background-color: #ECDCBA;
    margin: 0;
    padding: 0;
}

/* Responsive layout styles */
@media (max-width: 768px) {
    /* Adjust sidebar height in compact mode */
    aside {
        height: auto !important;
        max-height: none !important;
    }
}

/* Responsive layout styles */
body.compact-mode aside {
    height: auto !important;
    max-height: none !important;
}

/* Add bottom margin in compact mode for mobile devices */
@media (max-width: 768px) {
    main {
        margin-bottom: 2em !important;
        padding-bottom: 2em !important;
    }
}

/* Desktop mode specific styles */
body.desktop-mode aside {
    height: 100% !important;
}

/* Sidebar container styles */
.sidebar-container {
    /* Default is full height for desktop */
    height: 100%;
}

/* Sidebar container styles */
@media (max-width: 768px) {
    .sidebar-container {
        /* Auto height in compact mode to fit content */
        height: auto;
        min-height: 0;
    }
}

/* Always ensure selected projects are visible */
/* Always ensure activity summary is visible */
.activity-summary {
    display: inline-block !important;
}

/* Remove gap between selected project and details */
main .space-y-3 {
    margin-top: 0 !important;
}

.main_menu_button {
    background-color: #ECDCBA;
    color: #09304A;
    font-weight: bold;
    font-size: 1.6em;
    text-shadow: 2px 4px 4px rgba(0, 0, 0, 40%);
    border-radius: 5px;
    border: 4px solid #09304A;
    padding: 0.5rem !important;
    margin: 0 !important;
    display: flex;
    align-items: center;
}

.banner-logo {
    display: flex;
    justify-content: left;
    align-items: left;
    background-color: #ECDCBA;
}

.navigation_button {
    box-shadow: 2px 4px 4px rgba(0, 0, 0, 40%);
}

.main_content {
    min-height: 80%;
    max-height: 80%;
    min-width: 95%;
    max-width: 95%;
}

.top_nav a {
    color: #09304A;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.6em;
    text-shadow: 2px 4px 4px rgba(0, 0, 0, 40%);
}

.top_nav a:hover {
    text-decoration: underline;
    color: #A4281A;
}

/* Active project indicator */
.active-project {
    /* Add a highlight for active projects */
    border-color: #3b82f6 !important; /* blue-500 border */
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.7); /* more noticeable glow */
}

/* Consistent spacing for navigation links */
.sidebar-container .space-y-2 {
    margin-bottom: 0.75rem; /* Consistent bottom margin */
}

/* Consistent spacing for navigation elements */
.flex-col > div:first-child {
    margin-top: 0;
    padding-top: 0;
}

/* Remove excessive spacing between projects and navigation buttons */
.sidebar-container ul.space-y-2 {
    margin-top: 0;
    margin-bottom: 0;
}

/* Consistent button spacing */
.sidebar-container a {
    margin-bottom: 0.75rem !important; /* Force consistent spacing */
}

/* Fix inconsistent spacing between project items */
.sidebar-container li {
    margin-bottom: 0.75rem !important; /* Force consistent spacing */
}

.sidebar-container li:last-child {
    margin-bottom: 0 !important; /* No margin on last item */
}

/* Ensure consistent widths between sidebar and main content */
main .w-full {
    max-width: 100%;
    padding: 0;
}

/* Make the collapsible sections consistent with sidebar width */
main .rounded-md {
    margin-left: 0;
    margin-right: 0;
}

/* Reset any space-y classes to ensure our custom margins work properly */
.sidebar-container .space-y-2 > * + * {
    margin-top: 0 !important;
}

/* Simple responsive styles */
@media (max-width: 768px) {
    /* On small screens, ensure both columns get proper width and spacing */
    .flex-wrap aside {
        width: 100% !important;
        border-right: none !important;
        border-bottom: 1px solid #e5e7eb;
        max-height: 50vh;
        overflow-y: auto;
    }

    
    .flex-wrap main {
        width: 100% !important;
        padding-top: 1.5rem;
    }
    
    /* Add some breathing room between elements on mobile */
    .space-y-3 > * + * {
        margin-top: 0.75rem !important;
    }
}

/* Mobile detection styles - ensure everything works as expected on actual mobile devices */
@media only screen and (max-device-width: 768px) {
    /* Ensure the drawing panel is properly hidden on mobile */
    .drawing-panel {
        display: none !important;
    }
    
    /* Force flex-wrap to make sidebar and content stack vertically */
    .flex.h-full {
        display: flex !important;
        flex-direction: column !important;
    }
    
    /* Ensure sidebar takes full width */
    .flex.h-full > div:first-child,
    .sidebar-container,
    .flex > div.w-96 {
        width: 100% !important;
        min-width: 100% !important;
        flex: none !important;
    }
    
    /* Ensure main content takes full width */
    .flex.h-full > div:last-child,
    .flex > main,
    .flex > div.h-full.w-full {
        width: 100% !important;
        flex: 1 0 auto !important;
    }
    
    /* Hide drawing panel on mobile devices */
    .drawing-panel,
    .diagram-container,
    .svg-container {
        display: none !important;
    }
}

/* Styles for mobile devices detected by JavaScript */
body.mobile-device .flex.h-full {
    display: flex !important;
    flex-direction: column !important;
}

body.mobile-device .flex.h-full > div:first-child,
body.mobile-device .sidebar-container,
body.mobile-device .flex > div.w-96 {
    width: 100% !important;
    min-width: 100% !important;
    flex: none !important;
}

body.mobile-device .flex.h-full > div:last-child,
body.mobile-device .flex > main,
body.mobile-device .flex > div.h-full.w-full {
    width: 100% !important;
    flex: 1 0 auto !important;
}

body.mobile-device .drawing-panel,
body.mobile-device .diagram-container,
body.mobile-device .svg-container {
    display: none !important;
}

/* Add hover effects for links */
.sidebar a {
    transition: background-color 0.2s, color 0.2s;
}

/* Enhance contrast for better readability */
.sidebar li a:hover {
    background-color: #3b82f6; 
    color: white;
}

/* Make text more readable on blue backgrounds */
.bg-blue-900, .bg-blue-800 {
  color: #f8f8f8; /* Off-white/cream text color for better readability */
}

.bg-blue-900 h3, .bg-blue-800 h3,
.bg-blue-900 h4, .bg-blue-800 h4 {
  color: white;
}

.bg-blue-900 p, .bg-blue-800 p {
  color: #f8f8f8;
}

/* Better contrast for secondary text */
.text-blue-300 {
  color: #b4d0ff !important; /* Lighter blue for better readability */
}

.text-blue-200 {
  color: #d1e2ff !important; /* Even lighter blue, almost white */
}

/* Improved form placeholder colors */
.bg-blue-800 input::placeholder,
.bg-blue-800 textarea::placeholder {
  color: #d1e2ff !important; /* Very light blue for placeholders */
  opacity: 0.7;
}

/* Collapsible section styles */
[data-controller="collapsible-section"] .material-icons {
  transition: transform 0.2s ease;
}

[data-controller="collapsible-section"] [data-action="click->collapsible-section#toggle"] {
  cursor: pointer;
  user-select: none;
}

[data-controller="collapsible-section"] [data-action="click->collapsible-section#toggle"]:hover {
  opacity: 0.9;
}

[data-controller="collapsible-section"] [data-action="click->collapsible-section#toggle"]:hover .material-icons {
  color: white;
}

/* Collapsible section header */
[data-controller="collapsible-section"] h3 {
  transition: color 0.2s ease;
}

[data-controller="collapsible-section"] [data-action="click->collapsible-section#toggle"]:hover h3 {
  text-shadow: 0 0 1px rgba(255, 255, 255, 0.5);
}

/* Universal soft shadow for bordered elements */
.soft-shadow {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* DXF Viewer Fullscreen Styles */
body.compact-mode .dxf-viewer-frame {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 50 !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
}

/* Close button styles for compact mode */
body.compact-mode #dxf-close-btn {
    display: flex !important;
}

body.desktop-mode #dxf-close-btn {
    display: none !important;
}

/* Ensure close button is always on top */
#dxf-close-btn {
    z-index: 60 !important;
    position: absolute !important;
    top: 0.5rem !important;
    right: 0.5rem !important;
    background-color: #ef4444 !important;
    border: none !important;
    cursor: pointer !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent !important;
}

#dxf-close-btn:hover {
    background-color: #dc2626 !important;
    transform: scale(1.05) !important;
}

#dxf-close-btn:active {
    transform: scale(0.95) !important;
}

/* Add custom styles for invalid inputs */
input.invalid, textarea.invalid {
  border: 1px solid #EF4444 !important;
  background-color: #FBE8E8 !important; /* more reddish‑gray */
  /* Ensure border overrides other styles */
  border-color: #EF4444 !important;
  border-style: solid !important;
  border-width: 1px !important;
}