/* EvariLUX GIS Processing Frontend Styles */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

header p {
    color: #7f8c8d;
    font-size: 1.2rem;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.card h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.hidden {
    display: none !important;
}

/* Pipeline Selection */
.pipeline-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.pipeline-btn {
    background: white;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.pipeline-btn:hover {
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(52, 152, 219, 0.2);
}

.pipeline-btn.active {
    border-color: #3498db;
    background: #f8fafb;
}

.pipeline-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.pipeline-label {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
}

.pipeline-desc {
    font-size: 0.9rem;
    color: #7f8c8d;
}

/* File Upload */
.upload-area {
    border: 2px dashed #3498db;
    border-radius: 8px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8fafb;
}

.upload-area:hover {
    border-color: #2980b9;
    background: #ecf0f1;
}

.upload-area.dragover {
    border-color: #27ae60;
    background: #e8f5e8;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

#file-input {
    display: none;
}

.file-list {
    margin-top: 20px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8fafb;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid #e1e8ed;
}

.file-name {
    font-weight: 500;
    color: #2c3e50;
}

.file-size {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.file-remove {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.8rem;
}

/* Progress Bars */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #ecf0f1;
    border-radius: 4px;
    overflow: hidden;
    margin: 15px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.progress-section .progress-bar {
    flex: 1;
    margin: 0;
}

.progress-text {
    font-weight: 600;
    color: #2c3e50;
    min-width: 45px;
    text-align: right;
}

.progress-details {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.progress-message {
    font-size: 0.95rem;
    color: #6c757d;
    font-style: italic;
    text-align: center;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

/* UTM Zone, Hemisphere, and Vertical Datum inline styling */
.utm-zone-container {
    display: flex;
    gap: 20px;
    align-items: flex-end;
}

.utm-zone-field,
.hemisphere-field,
.vertical-datum-field {
    flex: 1;
}

.utm-zone-field {
    flex: 1; /* Equal space with hemisphere */
}

.hemisphere-field {
    flex: 1; /* Equal space with UTM zone */
}

.vertical-datum-field {
    flex: 2.5; /* Vertical Datum takes most space due to longer labels */
}

@media (max-width: 768px) {
    .utm-zone-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .utm-zone-field,
    .hemisphere-field,
    .vertical-datum-field {
        flex: none;
    }
}

/* Validation Messages */
.validation-messages {
    margin: 20px 0;
}

.validation-success,
.validation-errors {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.validation-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.validation-errors {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.success-icon,
.error-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.success-text,
.error-text {
    flex: 1;
    line-height: 1.5;
}

.error-text {
    white-space: pre-line;
}

/* CRS Info */
.crs-info {
    background: #f8fafb;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.crs-info h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

#current-crs {
    font-family: 'Courier New', monospace;
    background: white;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* Buttons */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #2980b9;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #7f8c8d;
}

.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

/* Processing Status */
.status-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.status-icon {
    font-size: 2rem;
}

.status-text {
    font-size: 1.2rem;
    color: #2c3e50;
}

.error-message {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

/* Download Results */
.download-info {
    text-align: center;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.download-info p {
    font-size: 1.2rem;
    margin-bottom: 25px;
    color: #27ae60;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-overlay.hidden {
    display: none !important;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #34495e;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: white;
    font-size: 1.2rem;
    margin-top: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Footer */
footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: #7f8c8d;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .pipeline-buttons {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .card {
        padding: 20px;
    }
}

/* Tooltip Styles */
.tooltip-container {
    position: relative;
    display: inline-block;
    margin-left: 5px;
}

.tooltip-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: #3498db;
    color: white;
    border-radius: 50%;
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    line-height: 16px;
    cursor: help;
}

.tooltip-text {
    visibility: hidden;
    width: 300px;
    background-color: #333;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -150px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
    line-height: 1.4;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.tooltip-container:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Field Mapping Layout */
.group-label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
}

.field-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.field-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.field-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #666;
    margin: 0;
}

.field-separator {
    display: none;
}

.field-item select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    background: white;
    min-width: 120px;
}

.field-item select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Responsive adjustments for field layout */
@media (max-width: 768px) {
    .field-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .field-separator {
        display: none;
    }
}