/* Green Button XML to CSV Converter Styles */

:root {
    --primary-color: #2e7d32;
    --primary-light: #4caf50;
    --primary-dark: #1b5e20;
    --secondary-color: #f8f9fa;
    --accent-color: #ff9800;
    --error-color: #f44336;
    --text-primary: #333;
    --text-secondary: #666;
    --border-color: #ddd;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: 600;
}

header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Upload Section */
.upload-section {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
}

.green-button-info {
    background: #f0f8ff;
    border: 2px solid var(--primary-light);
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    text-align: left;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.green-button-info h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    text-align: left;
}

.green-button-info ol {
    margin: 15px 0;
    padding-left: 20px;
}

.green-button-info li {
    margin: 8px 0;
    line-height: 1.5;
}

.green-button-info p {
    margin: 10px 0;
}

.green-button-info em {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.file-input-wrapper {
    position: relative;
    display: inline-block;
}

.file-input-wrapper input[type=file] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.file-input-label {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    padding: 15px 30px;
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    border: 2px solid var(--primary-color);
}

.file-input-label:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
}

.file-input-button {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
}

.file-info {
    margin-top: 20px;
    padding: 20px;
    background: var(--secondary-color);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.file-info p {
    margin: 5px 0;
    color: var(--text-secondary);
}

/* Processing Section */
.processing-section {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

#processingStatus {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Results Section */
.results-section {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.results-section h2 {
    color: var(--primary-color);
    margin-bottom: 30px;
    font-size: 1.8rem;
}

/* Metadata and Data Summary Sections */
.metadata-summary, .data-summary {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--secondary-color);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.metadata-summary h3, .data-summary h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.metadata-grid, .summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.metadata-item, .summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.metadata-label, .summary-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.metadata-item span:last-child, .summary-item span:last-child {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Legacy data-summary styling for backward compatibility */
.data-summary:not(.summary-grid) {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Remove this duplicate styling - now handled above in the unified section */

.export-options {
    margin-bottom: 30px;
    text-align: center;
}

.export-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.export-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.export-btn .icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Field Explanation Section */
.field-explanation {
    margin-bottom: 30px;
    padding: 20px;
    background: #fff8e1;
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
}

.field-explanation h3 {
    color: var(--accent-color);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.explanation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.explanation-item {
    padding: 10px;
    background: white;
    border-radius: 6px;
    font-size: 0.9rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.explanation-item strong {
    color: var(--primary-color);
}

/* Preview Section */
.preview-section h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.4rem;
}

.table-container {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

th {
    background: var(--secondary-color);
    font-weight: 600;
    color: var(--text-primary);
    position: sticky;
    top: 0;
    z-index: 1;
}

tbody tr:hover {
    background: #f8f9ff;
}

/* Specifications Section */
.specifications-section {
    margin-top: 40px;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.specifications-section h3 {
    color: var(--primary-color);
    margin-bottom: 25px;
    font-size: 1.5rem;
    text-align: center;
}

.spec-category {
    margin-bottom: 30px;
}

.spec-category h4 {
    color: var(--primary-dark);
    margin-bottom: 15px;
    font-size: 1.2rem;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-light);
}

.spec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.spec-item {
    padding: 15px;
    background: white;
    border-radius: 8px;
    border-left: 3px solid var(--accent-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-size: 0.9rem;
}

.spec-item strong {
    color: var(--primary-color);
    display: block;
    margin-bottom: 5px;
}

.spec-item em {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.85rem;
}

/* Calculation Example */
.calculation-example {
    margin-top: 25px;
}

.calculation-example h4 {
    color: var(--accent-color);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.example-box {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 20px;
    margin-top: 10px;
}

.example-box p {
    margin: 8px 0;
    line-height: 1.6;
}

.example-box p:first-child {
    margin-top: 0;
}

.example-box p:last-child {
    margin-bottom: 0;
    font-weight: 600;
    color: var(--primary-color);
}

/* Error Section */
.error-section {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
    border-left: 4px solid var(--error-color);
}

.error-section h2 {
    color: var(--error-color);
    margin-bottom: 20px;
}

#errorMessage {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 1.1rem;
    line-height: 1.6;
}

.reset-btn {
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease;
}

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

/* Footer */
footer {
    margin-top: 40px;
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    background: white;
    border-radius: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .upload-section,
    .processing-section,
    .results-section,
    .error-section {
        padding: 30px 20px;
    }
    
    .data-summary {
        grid-template-columns: 1fr;
    }
    
    .file-input-label {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .file-input-label {
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    th, td {
        padding: 8px;
        font-size: 0.8rem;
    }
}