﻿/* Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    padding: 0;
    margin: 0;
}

/* Layout */
.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Typography */
h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

h2 {
    font-size: 1.375rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #2c3e50;
}

h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #2c3e50;
}

p {
    margin-bottom: 1rem;
}

/* Header & Nav */
.ingredients-import__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e1e5e9;
}

.ingredients-import__title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    color: #2c3e50;
}

.ingredients-import__close {
    font-size: 1.5rem;
    color: #95a5a6;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    transition: all 0.2s ease;
}

    .ingredients-import__close:hover {
        background-color: #f1f2f3;
        color: #e74c3c;
    }

.breadcrumbs {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    font-size: 0.875rem;
}

    .breadcrumbs a {
        color: #3498db;
        text-decoration: none;
    }

        .breadcrumbs a:hover {
            text-decoration: underline;
        }

    .breadcrumbs .separator {
        margin: 0 0.5rem;
        color: #95a5a6;
    }

    .breadcrumbs .current {
        color: #7f8c8d;
        font-weight: 500;
    }

/* Vendor Selection */
.ingredients-import__vendor-selection {
    background-color: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.ingredients-import__section-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.ingredients-import__section-desc {
    margin-bottom: 1.25rem;
    color: #666;
}

.ingredients-import__field {
    margin-bottom: 1rem;
}

.ingredients-import__label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    color: #2c3e50;
}

.ingredients-import__input,
.ingredients-import__select {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid #dce4ec;
    border-radius: 0.25rem;
    font-size: 0.9375rem;
    transition: all 0.2s;
}

    .ingredients-import__input:focus,
    .ingredients-import__select:focus {
        border-color: #3498db;
        outline: none;
        box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
    }

/* Alerts */
.ingredients-import__alert {
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: flex-start;
}

.ingredients-import__alert--success {
    background-color: #e8f7f0;
    border-left: 4px solid #2ecc71;
    color: #27ae60;
}

.ingredients-import__alert--error {
    background-color: #fceaeb;
    border-left: 4px solid #e74c3c;
    color: #c0392b;
}

.ingredients-import__alert-icon {
    margin-right: 0.75rem;
    font-size: 1.125rem;
}

/* Upload Section */
.ingredients-import__upload {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.ingredients-import__upload-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem 1.25rem;
}

.ingredients-import__upload-icon {
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ebf5ff;
    border-radius: 50%;
    margin-bottom: 1.25rem;
}

    .ingredients-import__upload-icon svg {
        width: 1.75rem;
        height: 1.75rem;
        color: #3498db;
    }

.ingredients-import__upload-title {
    margin-bottom: 0.75rem;
    font-size: 1.375rem;
    font-weight: 600;
    color: #2c3e50;
}

.ingredients-import__upload-instructions {
    max-width: 31.25rem;
    margin: 0 auto 1.25rem;
}

.text-sm {
    font-size: 0.875rem;
}

.text-muted {
    color: #7f8c8d;
}

.ingredients-import__file-label {
    display: flex;
    align-items: center;
    border: 2px dashed #dce4ec;
    border-radius: 0.375rem;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    max-width: 25rem;
    margin-bottom: 1.25rem;
}

    .ingredients-import__file-label:hover {
        border-color: #3498db;
        background-color: #f8f9fa;
    }

.ingredients-import__file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.ingredients-import__file-button {
    background-color: #3498db;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    margin-right: 1rem;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.ingredients-import__file-label:hover .ingredients-import__file-button {
    background-color: #2980b9;
}

.ingredients-import__file-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.875rem;
}

/* Buttons */
.ingredients-import__upload-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
    font-size: 0.9375rem;
    background-color: #3498db;
    color: white;
}

    .ingredients-import__upload-button:hover {
        background-color: #2980b9;
    }

.ingredients-import__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
    font-size: 0.9375rem;
    background-color: #ecf0f1;
    color: #7f8c8d;
}

    .ingredients-import__button:hover {
        background-color: #dce4ec;
        color: #2c3e50;
    }

.ingredients-import__button--primary {
    background-color: #3498db;
    color: white;
}

    .ingredients-import__button--primary:hover {
        background-color: #2980b9;
    }

/* Sample Format */
.ingredients-import__sample {
    padding: 1rem 1.25rem;
    border-top: 1px solid #eee;
}

.ingredients-import__sample-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.75rem;
}

.ingredients-import__sample-code {
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    white-space: pre-wrap;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.875rem;
    overflow-x: auto;
    color: #444;
    border: 1px solid #eee;
    max-height: 11.25rem;
}

/* Results Summary */
.ingredients-import__results {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.ingredients-import__results-title {
    font-size: 1.375rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: #2c3e50;
}

.ingredients-import__stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9.375rem, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.ingredients-import__stat {
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    padding: 1.25rem 1rem;
    text-align: center;
    transition: transform 0.2s;
}

    .ingredients-import__stat:hover {
        transform: translateY(-2px);
    }

.ingredients-import__stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.375rem;
    display: block;
    color: #2c3e50;
}

.ingredients-import__stat-label {
    font-size: 0.875rem;
    color: #7f8c8d;
}

.ingredients-import__stat--success .ingredients-import__stat-value {
    color: #2ecc71;
}

.ingredients-import__stat--warning .ingredients-import__stat-value {
    color: #f1c40f;
}

/* Change tracking */
.ingredients-import__change-section {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background-color: #f9f9f9;
    border-radius: 0.375rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.ingredients-import__change-title {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
}

.ingredients-import__change-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9.375rem, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.ingredients-import__stat--price-change {
    background-color: #fff8e1;
    border-left: 3px solid #ffc107;
}

.ingredients-import__stat--unit-change {
    background-color: #e1f5fe;
    border-left: 3px solid #03a9f4;
}

.ingredients-import__stat--desc-change {
    background-color: #e8f5e9;
    border-left: 3px solid #4caf50;
}

.ingredients-import__stat--other-change {
    background-color: #f3e5f5;
    border-left: 3px solid #9c27b0;
}

/* Unit Type Mappings */
.unit-type-mappings {
    margin-top: 1.5rem;
}

.unit-type-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #e1e5e9;
    border-radius: 0.375rem;
    overflow: hidden;
    font-size: 0.9375rem;
}

    .unit-type-table th {
        background-color: #f5f7fa;
        text-align: left;
        padding: 0.75rem 1rem;
        font-weight: 600;
        border-bottom: 1px solid #e1e5e9;
    }

    .unit-type-table td {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #e1e5e9;
    }

    .unit-type-table tr:last-child td {
        border-bottom: none;
    }

/* Changed Items Table */
.ingredients-import__table-container {
    margin-top: 1rem;
    overflow-x: auto;
    border-radius: 0.375rem;
    border: 1px solid #e0e0e0;
}

.ingredients-import__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

    .ingredients-import__table th {
        background-color: #f5f5f5;
        text-align: left;
        padding: 0.75rem 0.8rem;
        border-bottom: 2px solid #e0e0e0;
        position: sticky;
        top: 0;
        z-index: 1;
    }

    .ingredients-import__table td {
        padding: 0.6rem 0.8rem;
        border-bottom: 1px solid #e0e0e0;
    }

.ingredients-import__row--changed {
    background-color: #fafafa;
}

.ingredients-import__change-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.375rem;
    height: 1.375rem;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: bold;
    margin-right: 0.3125rem;
}

.ingredients-import__change-icon--price {
    background-color: #fff8e1;
    color: #f57f17;
}

.ingredients-import__change-icon--unit {
    background-color: #e1f5fe;
    color: #0277bd;
}

.ingredients-import__change-icon--desc {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.ingredients-import__filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.ingredients-import__filter {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.ingredients-import__filter-checkbox {
    margin-right: 0.5rem;
}

.ingredients-import__legend {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.ingredients-import__legend-item {
    display: flex;
    align-items: center;
    font-size: 0.8125rem;
    color: #757575;
}

/* Actions */
.ingredients-import__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    border-radius: 0.5rem;
    width: 25rem;
    max-width: 90%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.modal-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #eee;
}

    .modal-header h2 {
        margin: 0;
        font-size: 1.25rem;
    }

.modal-body {
    padding: 1.5rem;
}

.progress-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.progress-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    animation: spin 1.5s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .ingredients-import__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .ingredients-import__close {
        position: absolute;
        top: 1rem;
        right: 1rem;
    }

    .breadcrumbs {
        flex-wrap: wrap;
    }

    .ingredients-import__file-label {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .ingredients-import__file-button {
        margin-right: 0;
        margin-bottom: 0.5rem;
        text-align: center;
    }

    .ingredients-import__actions {
        flex-direction: column;
    }

    .ingredients-import__button {
        width: 100%;
    }

    .ingredients-import__filters {
        flex-direction: column;
        align-items: flex-start;
    }

    .ingredients-import__legend {
        margin-top: 0.5rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    .ingredients-import__stats {
        grid-template-columns: 1fr;
    }

    .ingredients-import__change-stats {
        grid-template-columns: 1fr;
    }

    .ingredients-import__sample-code {
        font-size: 0.75rem;
    }
}
