/* Custom styles for Excel Comparison Tool */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    color: #333;
    background-color: #f5f7fa;
}

.results-title {
    margin-bottom: 15px;
}

.results-title h3 {
    color: #2c3e50;
    margin-bottom: 5px;
}

.results-title p {
    color: #7f8c8d;
    font-size: 0.9em;
    margin-top: 0;
}

.results-title strong {
    color: #e74c3c;
    font-weight: 800;
    font-size: 1.3em;
}

.instructions {
    background-color: #f0f7ff;
    border-left: 4px solid #3498db;
    padding: 15px 20px;
    margin-bottom: 25px;
    border-radius: 4px;
}

.instructions h3 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 10px;
}

.instructions p {
    margin-bottom: 10px;
}

.instructions ol, .instructions ul {
    margin-top: 5px;
    margin-bottom: 10px;
    padding-left: 20px;
}

.instructions li {
    margin-bottom: 5px;
}

.form-hint {
    font-size: 0.9em;
    color: #7f8c8d;
    margin-bottom: 15px;
    font-style: italic;
}

h1 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 30px;
    font-weight: 600;
}

h2 {
    color: #34495e;
    margin-top: 25px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.container {
    background-color: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.file-input {
    display: block;
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #dce4ec;
    border-radius: 4px;
    box-sizing: border-box;
    background-color: #f8f9fa;
    transition: border-color 0.3s;
}

.file-input:hover {
    border-color: #bdc3c7;
}

.file-input:focus {
    border-color: #3498db;
    outline: none;
}

.btn {
    background-color: #3498db;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    display: block;
    width: 100%;
    transition: background-color 0.3s;
    font-weight: 500;
}

.btn:hover {
    background-color: #2980b9;
}

.error {
    color: #e74c3c;
    margin-top: 15px;
    padding: 15px;
    background-color: #fadbd8;
    border-radius: 4px;
    border-left: 4px solid #e74c3c;
}

.error-detail {
    color: #7f8c8d;
    font-size: 0.9em;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(231, 76, 60, 0.3);
    font-family: monospace;
    white-space: pre-wrap;
    word-break: break-word;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

th, td {
    padding: 14px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #3498db;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9em;
}

tr:hover {
    background-color: #f5f5f5;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

.results-container {
    margin-top: 30px;
}

.no-results {
    text-align: left;
    padding: 30px;
    color: #7f8c8d;
    background-color: #f8f9fa;
    border-radius: 4px;
    margin-top: 20px;
    border-left: 4px solid #e74c3c;
}

.no-results strong {
    color: #e74c3c;
    font-size: 1.1em;
    display: inline-block;
    margin-bottom: 5px;
}

.no-results ul {
    margin-top: 10px;
    margin-bottom: 0;
    padding-left: 20px;
}

.no-results li {
    margin-bottom: 8px;
}

.export-options {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.csv-select {
    padding: 8px 12px;
    border: 1px solid #dce4ec;
    border-radius: 4px;
    background-color: #f8f9fa;
    font-size: 14px;
    color: #2c3e50;
    cursor: pointer;
}

.csv-select:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 3px rgba(52, 152, 219, 0.3);
}

.download-btn {
    background-color: #27ae60;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.download-btn:hover {
    background-color: #219653;
}

.search-input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #dce4ec;
    border-radius: 4px;
    font-size: 16px;
    margin-bottom: 15px;
    box-sizing: border-box;
}

.search-input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.copy-btn {
    background-color: #9b59b6;
    color: white;
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}

.copy-btn:hover {
    background-color: #8e44ad;
}

/* Sortable table headers */
th.sortable {
    cursor: pointer;
    position: relative;
    user-select: none;
    padding-right: 25px;
    transition: background-color 0.2s ease;
}

th.sortable:hover {
    background-color: #2980b9;
}

th.sortable .sort-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
    font-size: 16px;
    transition: opacity 0.2s ease;
}

th.sortable:hover .sort-icon {
    opacity: 1;
}

th.sortable::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #fff;
    transition: width 0.2s ease;
}

th.sortable:hover::after {
    width: 100%;
}

th.sort-asc .sort-icon {
    content: '↑';
    opacity: 1;
}

th.sort-asc .sort-icon:before {
    content: '↑';
}

th.sort-desc .sort-icon {
    opacity: 1;
}

th.sort-desc .sort-icon:before {
    content: '↓';
}

/* Highlight sorted column */
td.sorted {
    background-color: rgba(52, 152, 219, 0.1);
}

/* Add a subtle highlight to sorted column on hover */
tr:hover td.sorted {
    background-color: rgba(52, 152, 219, 0.2);
}

/* Screen reader only - for accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

@media (max-width: 768px) {
    th, td {
        padding: 10px;
        font-size: 0.9em;
    }
    
    .container {
        padding: 15px;
    }
    
    .copy-btn {
        padding: 4px 8px;
        font-size: 0.8em;
    }
    
    .search-input {
        padding: 8px;
    }
}

/* Loading indicator styles */
body.loading:after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 1000;
}

body.loading:before {
    content: 'Traitement en cours...';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px;
    background-color: #3498db;
    color: white;
    border-radius: 5px;
    z-index: 1001;
    font-weight: 600;
}