/* FlowPath Pipeline Analysis Tool Styles */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header Styles */
.app-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 2rem 0;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo {
    height: 60px;
    width: auto;
    border-radius: 8px;
}

.header-text h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.header-text p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Main Content */
.main-content {
    padding: 3rem 0;
    min-height: calc(100vh - 200px);
}

/* Upload Section */
.upload-section {
    max-width: 600px;
    margin: 0 auto;
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
}

.upload-section h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.upload-section p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.upload-form {
    text-align: left;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.submit-btn {
    width: 100%;
    background: var(--primary-color);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.submit-btn:hover {
    background: var(--primary-dark);
}

/* Error Messages */
.error-messages {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.error {
    color: var(--error-color);
    font-weight: 500;
}

/* Results Section */
.results-section {
    max-width: 1200px;
    margin: 0 auto;
}

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

.results-header h2 {
    font-size: 2.5rem;
    color: var(--text-primary);
}

.new-analysis-btn {
    background: var(--secondary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.new-analysis-btn:hover {
    background: #475569;
}

/* Analysis Cards */
.analysis-card,
.map-card,
.elevation-card,
.calculator-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.analysis-card h3,
.map-card h3,
.elevation-card h3,
.calculator-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

/* Analysis Grid */
.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.metric label {
    font-weight: 600;
    color: var(--text-secondary);
}

.metric span {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.1rem;
}

/* Map Container */
.map-container {
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--border-color);
}

/* Custom Leaflet Marker Styles */
.custom-marker {
    background: transparent;
    border: none;
    font-weight: bold;
    text-align: center;
}

.start-marker .marker-content {
    background: var(--success-color);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.end-marker .marker-content {
    background: var(--error-color);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* Elevation Chart */
.elevation-chart {
    height: 300px;
    width: 100%;
}

/* Calculator Form */
.calculator-form {
    margin-bottom: 2rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 1rem;
    align-items: end;
}

.calculate-btn {
    background: var(--success-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.calculate-btn:hover {
    background: #059669;
}

.calculate-btn:disabled {
    background: var(--secondary-color);
    cursor: not-allowed;
}

/* Calculation Results */
.calculation-results {
    border-top: 2px solid var(--border-color);
    padding-top: 2rem;
}

.calculation-results h4 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.results-table-container {
    overflow-x: auto;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.results-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.result-label {
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-color);
    width: 40%;
}

.result-value {
    font-weight: 500;
    color: var(--text-primary);
}

.results-table tr:last-child td {
    border-bottom: none;
}

.results-table tr:hover {
    background: var(--bg-color);
}

/* Footer */
.app-footer {
    background: var(--text-primary);
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
}

.disclaimer {
    margin-bottom: 1.5rem;
}

.disclaimer h4 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--warning-color);
}

.disclaimer p {
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0.9;
}

.footer-info {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #374151;
    opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .header-text h1 {
        font-size: 2rem;
    }
    
    .results-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .results-header h2 {
        font-size: 2rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .analysis-grid {
        grid-template-columns: 1fr;
    }
    
    .metric {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .analysis-card,
    .map-card,
    .elevation-card,
    .calculator-card {
        padding: 1.5rem;
    }
    
    .upload-section {
        padding: 2rem;
        margin: 0 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .upload-section {
        margin: 0 0.5rem;
        padding: 1.5rem;
    }
    
    .header-text h1 {
        font-size: 1.75rem;
    }
    
    .results-table {
        font-size: 0.9rem;
    }
    
    .results-table td {
        padding: 0.75rem;
    }
}

/* Loading and Interactive States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Print Styles */
@media print {
    .app-header,
    .new-analysis-btn,
    .upload-section,
    .app-footer {
        display: none;
    }
    
    .results-section {
        max-width: none;
    }
    
    .analysis-card,
    .map-card,
    .elevation-card,
    .calculator-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
}