/* CEO CSV CrossWalk Tool Styles */
/* CEO Brand Colors: Green (#2A8A2B) */

:root {
    --ceo-green: #2A8A2B;
    --ceo-green-dark: #1F6B20;
    --ceo-green-light: #E8F5E9;
    --text-primary: #212529;
    --text-secondary: #495057;
    --border-color: #dee2e6;
    --background-light: #f8f9fa;
    --error-color: #dc3545;
    --warning-color: #ffc107;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --focus-shadow: 0 0 0 0.2rem rgba(42, 138, 43, 0.25);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: #fff;
}

/* Utility Classes */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.hidden {
    display: none !important;
}

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

/* Header Styles */
.header {
    background-color: #fff;
    border-bottom: 4px solid var(--ceo-green);
    padding: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-circle {
    width: 100px;
    height: 100px;
    background-color: var(--ceo-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-text {
    color: white;
    font-size: 36px;
    font-weight: 300;
    letter-spacing: -2px;
}

.organization-name {
    font-size: 32px;
    font-weight: bold;
    line-height: 1.2;
    margin: 0;
}

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

.tool-title {
    font-size: 28px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.tool-description {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

/* Message Container */
.message-container {
    margin-bottom: 20px;
}

.message {
    padding: 12px 20px;
    border-radius: 4px;
    margin-bottom: 10px;
    font-weight: 500;
}

.message-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.message-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Section Styles */
.mapping-section,
.file-operations,
.results-section {
    background-color: var(--background-light);
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.section-title {
    font-size: 22px;
    margin-bottom: 20px;
    color: var(--ceo-green-dark);
}

/* Table Styles */
.mapping-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    margin-bottom: 20px;
}

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

.mapping-table th {
    background-color: var(--ceo-green);
    color: white;
    font-weight: 600;
}

.mapping-table tr:hover {
    background-color: var(--ceo-green-light);
}

.action-cell {
    width: 100px;
    text-align: center;
}

/* Form Elements */
.form-select,
.form-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: #fff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-select:focus,
.form-input:focus {
    outline: none;
    border-color: var(--ceo-green);
    box-shadow: var(--focus-shadow);
}

.form-select:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.btn:focus {
    outline: none;
    box-shadow: var(--focus-shadow);
}

.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--ceo-green);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--ceo-green-dark);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #5a6268;
}

.btn-remove {
    padding: 6px 12px;
    font-size: 14px;
    background-color: var(--error-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

.btn-remove:hover {
    background-color: #c82333;
}

.btn-remove:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* File Operations */
.file-operations {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.operation-group {
    flex: 1;
    min-width: 250px;
}

.operation-title {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--text-secondary);
}

.file-input-wrapper {
    margin-bottom: 15px;
}

.file-input-wrapper label {
    margin-bottom: 0;
}

.filename-display {
    display: block;
    margin-top: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.config-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Results Section */
.table-wrapper {
    overflow-x: auto;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    font-size: 14px;
}

.results-table th,
.results-table td {
    padding: 8px;
    border: 1px solid var(--border-color);
}

.results-table th {
    background-color: var(--ceo-green);
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.results-table tr:nth-child(even) {
    background-color: var(--background-light);
}

.more-rows-indicator {
    text-align: center;
    font-style: italic;
    color: var(--text-secondary);
    background-color: var(--background-light);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay p {
    color: white;
    font-size: 18px;
    margin-top: 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--ceo-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Footer */
.footer {
    background-color: var(--text-primary);
    color: white;
    padding: 30px 0;
    text-align: center;
}

.footer a {
    color: white;
    text-decoration: underline;
}

.footer a:hover {
    text-decoration: none;
}

.footer-links {
    margin-top: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .logo-section {
        flex-direction: column;
        text-align: center;
    }
    
    .organization-name {
        font-size: 24px;
    }
    
    .tool-title {
        font-size: 24px;
    }
    
    .mapping-table {
        font-size: 14px;
    }
    
    .mapping-table th,
    .mapping-table td {
        padding: 8px 4px;
    }
    
    .file-operations {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .header {
        border-bottom-width: 6px;
    }
    
    .btn:focus,
    .form-select:focus,
    .form-input:focus {
        outline: 3px solid currentColor;
        outline-offset: 2px;
        box-shadow: none;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    .header,
    .file-operations,
    .table-actions,
    .btn,
    .loading-overlay,
    .footer {
        display: none !important;
    }
    
    .main-content {
        padding: 0;
    }
    
    .mapping-section,
    .results-section {
        box-shadow: none;
        page-break-inside: avoid;
    }
}