/* CSV Comparator CSS */

.csv-comparator-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.comparator-header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    animation: slideDown 0.6s ease-out;
}

.comparator-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.comparator-header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.comparator-layout {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.file-upload-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.upload-box h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.file-input-wrapper {
    position: relative;
    margin-bottom: 15px;
}

.file-input {
    display: none;
}

.file-drop-zone {
    border: 2px dashed #667eea;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #f8f9ff;
}

.file-drop-zone:hover {
    border-color: #764ba2;
    background: #f0f2ff;
}

.file-drop-zone.dragover {
    border-color: #27ae60;
    background: #d5f4e6;
}

.upload-icon {
    display: block;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.file-drop-zone p {
    margin: 8px 0;
    color: #2c3e50;
    font-weight: 600;
}

.file-drop-zone small {
    display: block;
    color: #7f8c8d;
}

.file-info {
    min-height: 40px;
    padding: 10px;
    background: #f0f2ff;
    border-radius: 5px;
    margin-bottom: 15px;
    display: none;
}

.file-info.active {
    display: block;
}

.file-name {
    font-weight: 600;
    color: #667eea;
    margin-bottom: 5px;
}

.file-details {
    font-size: 12px;
    color: #7f8c8d;
}

.columns-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ecf0f1;
}

.section-label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.column-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #bdc3c7;
    border-radius: 5px;
    font-size: 13px;
    cursor: pointer;
}

.column-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.helper-text {
    display: block;
    margin-top: 5px;
    font-size: 11px;
    color: #7f8c8d;
}

.comparison-settings {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.settings-box {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.settings-box h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.setting-item {
    margin-bottom: 15px;
}

.setting-item label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 6px;
}

.setting-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #bdc3c7;
    border-radius: 5px;
    font-size: 13px;
    cursor: pointer;
}

.setting-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.setting-item input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.btn-compare {
    width: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    margin-top: 10px;
}

.btn-compare:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-compare:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-preview {
    background: #3498db;
    color: white;
}

.btn-download {
    background: #27ae60;
    color: white;
}

.btn-reset {
    background: #e74c3c;
    color: white;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.results-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
}

.results-header h2 {
    margin: 0;
    color: #2c3e50;
}

.results-controls {
    display: flex;
    gap: 10px;
}

.comparison-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-card.match {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
}

.stat-card.mismatch {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.stat-percentage {
    font-size: 1.8rem;
    font-weight: 700;
    color: #27ae60;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.results-table-container {
    overflow-x: auto;
    margin-top: 20px;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.results-table thead {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.results-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
}

.results-table tbody tr {
    border-bottom: 1px solid #ecf0f1;
    transition: background-color 0.2s;
}

.results-table tbody tr:hover {
    background-color: #f8f9fa;
}

.results-table td {
    padding: 12px 15px;
    font-size: 13px;
}

.results-table td:first-child {
    font-weight: 600;
    color: #667eea;
    width: 50px;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 12px;
    text-align: center;
}

.status-match {
    background-color: #d4edda;
    color: #155724;
}

.status-mismatch {
    background-color: #f8d7da;
    color: #721c24;
}

.row-match {
    background-color: #d4edda !important;
}

.row-mismatch {
    background-color: #f8d7da !important;
}

.row-notfound {
    background-color: #fff3cd !important;
}

.text-center {
    text-align: center;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 10px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid #ecf0f1;
}

.modal-header h2 {
    margin: 0;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #7f8c8d;
}

.modal-close:hover {
    color: #2c3e50;
}

.modal-body {
    padding: 20px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

.preview-info {
    margin-bottom: 20px;
    padding: 15px;
    background: #f0f2ff;
    border-radius: 5px;
    border-left: 4px solid #667eea;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.preview-table th,
.preview-table td {
    padding: 10px;
    text-align: left;
    border: 1px solid #ecf0f1;
}

.preview-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    position: sticky;
    top: 0;
    z-index: 10;
}

.preview-table tbody tr:hover {
    background-color: #f0f2ff;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #2c3e50;
    color: white;
    padding: 15px 20px;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease-out;
    z-index: 2000;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Preview Section Styles */
.preview-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

.preview-section h3 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 1.2rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.preview-file {
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    padding: 10px;
    overflow: auto;
    max-height: 400px;
}

.preview-search-box {
    margin-bottom: 10px;
}

.preview-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 13px;
    box-sizing: border-box;
}

.preview-search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.preview-file h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #4f46e5;
    font-size: 0.95rem;
    padding-bottom: 8px;
    border-bottom: 2px solid #4f46e5;
}

.preview-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.preview-data-table thead {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.preview-data-table th {
    padding: 8px;
    text-align: left;
    border-bottom: 2px solid #ddd;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-data-table td {
    padding: 8px;
    border-bottom: 1px solid #eee;
    color: #555;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-data-table tbody tr:hover {
    background: #f0f2ff;
}

@media (max-width: 900px) {
    .preview-container {
        grid-template-columns: 1fr;
    }
}

/* Filter Buttons */
.filter-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid #ddd;
    background: white;
    color: #2c3e50;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: #667eea;
    background: #f0f2ff;
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: #667eea;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .comparator-layout {
        grid-template-columns: 1fr;
    }

    .comparison-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .comparator-header h1 {
        font-size: 1.8rem;
    }

    .comparator-header p {
        font-size: 0.9rem;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .results-controls {
        flex-wrap: wrap;
        margin-top: 10px;
    }

    .results-controls .btn {
        flex: 1;
        min-width: 100px;
    }

    .comparison-stats {
        grid-template-columns: 1fr;
    }

    .results-table {
        font-size: 12px;
    }

    .results-table td,
    .results-table th {
        padding: 8px;
    }

    .modal-content {
        max-width: 95%;
    }
}
