/**
 * CSV Merger - Stylesheet
 */

.csv-merger-container {
    max-width: 1200px;
    margin: 20px auto;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Tool header (frontend only) */
.csv-merger-header {
    margin-bottom: 36px;
    padding-bottom: 28px;
    border-bottom: 3px solid #0073aa;
}

.csv-merger-title {
    font-size: 28px;
    font-weight: 700;
    color: #0073aa;
    margin: 0 0 6px;
    line-height: 1.2;
}

.csv-merger-tagline {
    font-size: 15px;
    color: #555;
    margin: 0 0 18px;
    font-style: italic;
}

.csv-merger-description > p {
    font-size: 14px;
    color: #444;
    line-height: 1.7;
    margin-bottom: 20px;
}

.csv-merger-use-cases {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.use-case {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #f0f7fb;
    border: 1px solid #c8e0ee;
    border-radius: 6px;
    padding: 14px 16px;
}

.use-case-icon {
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.use-case strong {
    display: block;
    font-size: 13px;
    color: #0073aa;
    margin-bottom: 4px;
}

.use-case span {
    font-size: 12px;
    color: #555;
    line-height: 1.5;
}

.csv-merger-privacy-note {
    font-size: 12px;
    color: #2e7d32;
    background: #f1f8f1;
    border-left: 3px solid #4caf50;
    border-radius: 4px;
    padding: 8px 12px;
    margin: 0 !important;
}

.csv-merger-container h1 {
    color: #23282d;
    margin-bottom: 30px;
    font-size: 28px;
}

.csv-merger-container h2 {
    color: #23282d;
    font-size: 20px;
    margin-top: 20px;
    margin-bottom: 15px;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.csv-merger-container h3 {
    color: #32373c;
    font-size: 16px;
    margin-top: 15px;
    margin-bottom: 10px;
}

/* Steps */
.csv-merger-step {
    animation: fadeIn 0.3s ease-in;
}

.csv-merger-step.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.csv-merger-step > p {
    color: #666;
    margin-bottom: 20px;
    font-size: 14px;
}

/* File Upload Section */
.csv-merger-file-upload {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.upload-section {
    background: #f9f9f9;
    padding: 20px;
    border: 2px dashed #0073aa;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.upload-section:hover {
    background: #f5f5f5;
    border-color: #005a87;
}

.upload-section h3 {
    margin-top: 0;
    color: #0073aa;
}

.upload-section p {
    color: #666;
    font-size: 13px;
    margin-bottom: 15px;
}

.csv-merger-file-input {
    display: block;
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    background: #fff;
}

.csv-merger-file-input:hover {
    border-color: #0073aa;
    background: #f9f9f9;
}

.file-info {
    display: block;
    margin-top: 10px;
    font-size: 13px;
    color: #666;
}

.files-list {
    margin-top: 15px;
}

.file-item {
    padding: 8px 12px;
    background: #e8f4f8;
    border-left: 3px solid #0073aa;
    margin-bottom: 8px;
    border-radius: 3px;
    font-size: 13px;
    color: #0073aa;
}

/* Mapping Section */
.mapping-container {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 30px;
    max-height: 600px;
    overflow-y: auto;
}

.mapping-section {
    background: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.mapping-section h3 {
    margin-top: 0;
    color: #0073aa;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.mapping-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.mapping-table thead {
    background: #f1f1f1;
}

.mapping-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #23282d;
    border-bottom: 2px solid #ddd;
}

.mapping-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.mapping-table tr:hover {
    background: #f9f9f9;
}

/* Skipped row – muted appearance */
.mapping-row--skipped td {
    opacity: 0.55;
}
.mapping-row--skipped .data-column {
    color: #888;
    font-weight: 400;
}

/* Mapped row – clear, highlighted */
.mapping-row--mapped td {
    opacity: 1;
}
.mapping-row--mapped {
    background: #f0fbf4;
}
.mapping-row--mapped .data-column {
    color: #1a7340;
    font-weight: 600;
}
.mapping-row--mapped .master-select {
    border-color: #4caf50;
    background: #f6fff8;
}

/* "optional" note in table header */
.mapping-optional {
    font-weight: 400;
    font-size: 11px;
    color: #888;
    margin-left: 4px;
}

.mapping-table .data-column {
    color: #0073aa;
    font-weight: 500;
    width: 40%;
}

.mapping-table .master-column {
    width: 60%;
}

.master-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #23282d;
    font-size: 13px;
    cursor: pointer;
}

.master-select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 3px rgba(0, 115, 170, 0.3);
}

/* Buttons – self-contained, work on admin and frontend */
.button-group {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

.csv-btn {
    display: inline-block;
    padding: 10px 22px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #f3f3f3;
    color: #23282d;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease;
    box-sizing: border-box;
}

.csv-btn:hover {
    background: #e5e5e5;
    border-color: #999;
    color: #23282d;
}

.csv-btn:active {
    transform: translateY(1px);
}

.csv-btn-primary {
    background: #0073aa;
    color: #fff !important;
    border-color: #005a87;
    padding: 10px 28px;
    font-size: 14px;
}

.csv-btn-primary:hover {
    background: #005a87;
    border-color: #003f5c;
    color: #fff;
}

.csv-btn:focus,
.csv-btn-primary:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Download Info */
#download-info {
    margin-bottom: 30px;
}

.success-message {
    padding: 15px 20px;
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
    border-radius: 4px;
    color: #2e7d32;
    font-size: 14px;
}

.success-message strong {
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
}

/* Notifications */
#csv-merger-notifications {
    position: fixed;
    top: 50px;
    right: 20px;
    z-index: 9999;
}

.csv-merger-notification {
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 4px;
    font-size: 13px;
    animation: slideIn 0.3s ease-out;
}

.notification-info {
    background: #e3f2fd;
    color: #1565c0;
    border-left: 4px solid #1565c0;
}

.notification-success {
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #4caf50;
}

.notification-error {
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid #f44336;
}

.notification-warning {
    background: #fff3e0;
    color: #e65100;
    border-left: 4px solid #ff9800;
}

.csv-merger-notification.fade-out {
    animation: slideOut 0.3s ease-out;
    opacity: 0;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .csv-merger-file-upload {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .mapping-container {
        max-height: 400px;
    }

    .button-group {
        flex-direction: column;
    }

    .csv-btn {
        width: 100%;
        text-align: center;
    }

    #csv-merger-notifications {
        left: 10px;
        right: 10px;
        top: auto;
        bottom: 10px;
    }

    .mapping-table {
        font-size: 12px;
    }

    .mapping-table th,
    .mapping-table td {
        padding: 8px;
    }
}

/* Accessibility */
.csv-merger-file-input:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.master-select:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}
