/* ===================================================================
   MapCreation Application Styles
   =================================================================== */

/* Layout Components */
.map-container {
    height: 600px;
    width: 100%;
    border: 2px solid #ddd;
    border-radius: 8px;
}

.statistics-panel {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

/* Navigation */
.navbar-brand {
    font-weight: bold;
}

/* Form Elements */
.coordinates-input {
    font-family: 'Courier New', monospace;
}

/* UI States */
.loading-spinner {
    display: none;
}

.simplification-spinner {
    display: none;
}

/* Download section hidden by default */
.download-section {
    display: none;
}

/* Override for when section should be visible */
.download-section.visible {
    display: block !important;
}

/* Frame Drag Marker Styles */
.frame-drag-marker {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #007bff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: move;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.frame-drag-marker:hover {
    background: rgba(0, 123, 255, 0.1);
    border-color: #0056b3;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transform: scale(1.1);
}

.frame-drag-marker .drag-handle {
    color: #007bff;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.frame-drag-marker:hover .drag-handle {
    color: #0056b3;
}

.frame-drag-marker svg {
    width: 16px;
    height: 16px;
    pointer-events: none;
}

/* Frame Resize Marker Styles */
.frame-resize-marker {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #28a745;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: nw-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.frame-resize-marker:hover {
    background: rgba(40, 167, 69, 0.1);
    border-color: #1e7e34;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transform: scale(1.1);
}
.frame-resize-marker .resize-handle {
    color: #28a745;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.frame-resize-marker:hover .resize-handle {
    color: #1e7e34;
}
.frame-resize-marker svg {
    width: 14px;
    height: 14px;
    pointer-events: none;
}

/* Section Display States */
#resultsSection {
    display: none;
}

#millableParams {
    display: none;
}

#validationPanel {
    display: none;
}

#errorSection {
    display: none;
}

#presetMillableParams {
    display: none;
}

#updatePresetBtn {
    display: none;
}

/* Validation Legend Icons */
.validation-legend-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    margin-right: 8px;
}

.validation-legend-icon.critical {
    background-color: #dc3545;
}

.validation-legend-icon.warning {
    background-color: #ffc107;
}

.validation-legend-icon.info {
    background-color: #17a2b8;
}

.validation-legend-icon.micro {
    background-color: #6c757d;
}

/* Special Form Elements */
.frame-scaling-display {
    height: auto;
    padding: 8px;
}

.download-quality-selector {
    width: 220px;
}

/* Custom Bootstrap Button Variants - None currently needed */

/* ===================================================================
   Unified Layout System - Phase 4 Enhancements
   =================================================================== */

/* Main Layout Structure */
.unified-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Sticky Header */
.unified-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Preset section styling */
.input-section .btn-group {
    width: 100%;
}

.input-section .btn-group .btn {
    flex: 1;
}

/* Two-Pane Content Layout */
.unified-content {
    display: flex;
    flex: 1;
    min-height: 0;
}

/* Input Panel (Left) */
.input-panel {
    width: 350px;
    min-width: 300px;
    max-width: 500px;
    background: #f8f9fa;
    border-right: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

.input-panel.collapsed {
    margin-left: -320px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #e9ecef;
    border-bottom: 1px solid #dee2e6;
}

.panel-toggle {
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-toggle .collapse-icon {
    transition: transform 0.3s ease;
}

.input-panel.collapsed .collapse-icon {
    transform: rotate(180deg);
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

/* Input Sections */
.input-section {
    margin-bottom: 2rem;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1rem;
}

.section-title {
    color: #495057;
    font-weight: 600;
    margin-bottom: 1rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

/* Results Panel (Right) */
.results-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.results-panel .panel-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
}

/* Tab System */
.results-tabs {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 0 1rem;
}

.results-tabs .nav-link {
    border: none;
    color: #6c757d;
    font-weight: 500;
    padding: 1rem 1.5rem;
}

.results-tabs .nav-link.active {
    background: #fff;
    color: #495057;
    border-bottom: 3px solid #0d6efd;
}

.results-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tab-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
}

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

.tab-body {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

/* Map Container for Unified Layout */
.map-container-unified {
    height: 500px;
    width: 100%;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    background: #f8f9fa;
}

/* Statistics Panel for Unified Layout */
.statistics-panel-unified {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1rem;
}

/* Error Display for Unified Layout */
.unified-error {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    max-width: 400px;
    z-index: 1050;
    margin: 0;
}

/* Material Design 3 Inspired Elements */
.btn {
    border-radius: 20px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #ced4da;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.1);
}

.input-section {
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Skeleton Loaders */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 1rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.skeleton-button {
    height: 2.5rem;
    border-radius: 20px;
    width: 100%;
}

.skeleton-map {
    height: 500px;
    border-radius: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .unified-content {
        flex-direction: column;
    }
    
    .input-panel {
        width: 100%;
        min-width: auto;
        max-width: none;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
    }
    
    .input-panel.collapsed {
        margin-left: 0;
        margin-top: -100%;
    }
    
    /* Header is now simpler without preset controls */
    
    .map-container-unified {
        height: 400px;
    }
}

@media (max-width: 576px) {
    .unified-header {
        padding: 0.5rem 0;
    }
    
    .unified-header h1 {
        font-size: 1.25rem;
    }
    
    .panel-content {
        padding: 0.5rem;
    }
    
    .tab-body {
        padding: 0.5rem;
    }
}

/* Enhanced Focus States for Accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus,
.nav-link:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .input-section {
        border-width: 2px;
    }
    
    .unified-header {
        border-bottom-width: 2px;
    }
    
    .results-tabs .nav-link.active {
        border-bottom-width: 4px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .input-panel,
    .panel-toggle .collapse-icon,
    .btn,
    .form-control,
    .form-select {
        transition: none;
    }
    
    .skeleton {
        animation: none;
    }
}