/* Main Styles for CSV to EDIFACT Converter */

:root {
    --primary-color: #0066b2;
    --secondary-color: #0052cc;
    --accent-color: #00a3e0;
    --light-color: #f5f7fa;
    --dark-color: #333;
    --border-color: #ddd;
    --success-color: #28a745;
    --error-color: #dc3545;
    --warning-color: #ffc107;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--light-color);
}

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

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

header h1 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

section {
    margin-bottom: 40px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 25px;
}

section h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

/* Upload Section */
.upload-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    border: 2px dashed var(--border-color);
    border-radius: 5px;
    background-color: #f9f9f9;
    transition: all 0.3s ease;
}

.upload-container:hover {
    border-color: var(--accent-color);
}

.file-input {
    display: none;
}

.file-label {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-weight: 600;
    margin-bottom: 15px;
}

.file-label:hover {
    background-color: var(--secondary-color);
}

.file-name {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}

/* Preview Section */
.preview-container {
    margin-top: 20px;
}

.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Tables */
.data-table, .mapping-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 14px;
}

.data-table th, .data-table td,
.mapping-table th, .mapping-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th, .mapping-table th {
    background-color: #f2f2f2;
    font-weight: 600;
}

.data-table tr:hover, .mapping-table tr:hover {
    background-color: #f9f9f9;
}

.csv-table-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

/* Convert Section */
.primary-btn {
    padding: 12px 24px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.primary-btn:hover {
    background-color: var(--secondary-color);
}

.primary-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.validation-messages {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
}

.validation-error {
    background-color: #f8d7da;
    color: var(--error-color);
    border: 1px solid #f5c6cb;
    padding: 10px;
    margin-top: 10px;
    border-radius: 4px;
}

.validation-success {
    background-color: #d4edda;
    color: var(--success-color);
    border: 1px solid #c3e6cb;
    padding: 10px;
    margin-top: 10px;
    border-radius: 4px;
}

/* Result Section */
.result-container {
    margin-top: 20px;
}

.edifact-output {
    background-color: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.edifact-output pre {
    font-family: 'Courier New', Courier, monospace;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.secondary-btn {
    padding: 10px 20px;
    background-color: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.secondary-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

.secondary-btn:disabled {
    border-color: #cccccc;
    color: #cccccc;
    cursor: not-allowed;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px 0;
    color: #666;
    border-top: 1px solid var(--border-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    section {
        padding: 15px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .tab-btn {
        padding: 8px 15px;
        font-size: 14px;
    }
    
    .data-table th, .data-table td,
    .mapping-table th, .mapping-table td {
        padding: 8px 10px;
        font-size: 13px;
    }
}