/* Magento Modal Styling for CSV Import */
/* Note: Common modal styles (header, title, close button, blur) are in _extend.less */
.modal-popup.csv-import-modal .modal-inner-wrap {
    max-width: 645px;
    width: 90%;
    max-height: 90vh;
}

.csv-import-modal .modal-content {
    padding: 0;
    max-height: calc(85vh - 60px);
    overflow-y: auto;
}

.csv-content {
    padding: 15px;
}

.csv-dialog label{
    vertical-align: text-bottom;
    padding-left: 5px;
}

.csv-dialog .ezdz-dropzone{
    border: 3px dashed lightgray;
    -webkit-border-radius: unset;
    -moz-border-radius: unset;
    border-radius: unset;
}

/* Simplified Mapping UI Styles */
#mapping-container {
    background: white;
    padding: 15px;
    border: 1px solid #c2c2c2;
    border-radius: 3px;
    margin-top: 15px;
}

.csv-mapping-table {
    width: 100%;
    border-collapse: collapse;
}

.csv-mapping-table td {
    padding: 3px;
    vertical-align: middle;
}

.csv-mapping-table td:first-child {
    width: 150px;
    font-weight: bold;
    color: #333;
}

.csv-mapping-table td:nth-child(2) {
    width: 250px;
}

.csv-mapping-table td:nth-child(3) {
    padding-left: 15px;
}

.csv-mapping-table label {
    display: inline-block;
    margin-bottom: 0;
    padding-left: 0;
}

.csv-mapping-table .mapping-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #c2c2c2;
    border-radius: 3px;
    background-color: #fff;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    line-height: 15px;
}

.csv-mapping-table .mapping-select:focus {
    outline: none;
    border-color: #000;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.2);
}

.csv-mapping-table .help-text {
    font-size: 0.9em;
    color: #666;
    font-style: italic;
}

/* File Error Message Styles */
.file-error {
    background: #fff5f5;
    border: 1px solid #e74c3c;
    border-left: 4px solid #e74c3c;
    padding: 12px 15px;
    margin-bottom: 15px;
    border-radius: 3px;
    color: #c0392b;
    font-size: 14px;
}

.file-error i {
    margin-right: 8px;
    color: #e74c3c;
}

/* Import Results Container */
.import-results {
    margin-top: 15px;
}

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

.import-success,
.import-warning,
.import-info {
    padding: 5px;
    margin-bottom: 8px;
    border-radius: 3px;
    font-size: 14px;
}

.import-success {
    background: #eafaf1;
    border-left: 4px solid #27ae60;
    color: #186a3b;
}

.import-success i {
    color: #27ae60;
    margin-right: 8px;
}

.import-warning {
    background: #fef5e7;
    border-left: 4px solid #f39c12;
    color: #9a6b00;
}

.import-warning i {
    color: #f39c12;
    margin-right: 8px;
}

.import-info {
    background: #ebf5fb;
    border-left: 4px solid #3498db;
    color: #1f618d;
}

.import-info i {
    color: #3498db;
    margin-right: 8px;
}

/* Results Table Wrapper - Scrollable */
.results-table-wrapper {
    max-height: 150px;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: white;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.results-table thead {
    background: #f0f0f0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.results-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
    color: #333;
}

.results-table tbody tr {
    border-bottom: 1px solid #eee;
}

.results-table tbody tr:hover {
    background: #f9f9f9;
}

.results-table td {
    padding: 10px 12px;
    color: #555;
}

/* Row column - narrow (1st column) */
.results-table th:nth-child(1),
.results-table td:nth-child(1) {
    width: 50px;
    min-width: 50px;
    max-width: 50px;
    text-align: center;
}

/* Identifier column - wider (2nd column) */
.results-table th:nth-child(2),
.results-table td:nth-child(2) {
    width: auto;
    min-width: 180px;
    text-align: left;
    font-weight: normal;
}

/* Qty column - narrow (3rd column) */
.results-table th:nth-child(3),
.results-table td:nth-child(3) {
    width: 50px;
    min-width: 50px;
    max-width: 50px;
    text-align: center;
    font-weight: 500;
}

/* Reason column - wider (4th column) */
.results-table th:nth-child(4),
.results-table td:nth-child(4) {
    width: auto;
    min-width: 140px;
    font-style: italic;
}

/* Reason-specific styling */
.reason-invalid-format {
    color: #e74c3c !important;
    font-weight: 500;
}

.reason-not-in-catalog {
    color: #e67e22 !important;
}

.reason-no-pricing {
    color: #f39c12 !important;
}

.reason-invalid-data {
    color: #95a5a6 !important;
}

/* Scrollbar styling for results table */
.results-table-wrapper::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.results-table-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.results-table-wrapper::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.results-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Button Styles for Multi-Step Workflow */
.btn-custom-success {
    background-color: #27ae60 !important;
    border-color: #27ae60 !important;
    color: white !important;
}

.btn-custom-success:hover {
    background-color: #229954 !important;
    border-color: #229954 !important;
}

.csv-dialog .button {
    padding: 3px;
    border-radius: 3px;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid #ccc;
    transition: all 0.2s ease;
}

.csv-dialog .button:hover {
    opacity: 0.9;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .csv-mapping-table td:first-child {
        width: 120px;
        font-size: 0.9em;
    }

    .csv-mapping-table td:nth-child(2) {
        width: 180px;
    }

    .csv-mapping-table td:nth-child(3) {
        display: none; /* Hide help text on mobile */
    }

    .csv-dialog {
        min-width: 300px;
    }

    .results-table {
        font-size: 12px;
    }

    .results-table th,
    .results-table td {
        padding: 8px 6px;
    }

    .results-table-wrapper {
        max-height: 250px;
    }
}