/* Multi-Store Management Styles */

.multi-store-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    background: #f5f5f5;
    min-height: 100vh;
}

.multi-store-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.multi-store-header h1 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 28px;
}

.multi-store-header .subtitle {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Tabs */
.tabs {
    display: flex;
    background: white;
    border-radius: 8px 8px 0 0;
    padding: 0;
    margin-bottom: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow-x: auto;
}

.tab {
    padding: 16px 24px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab:hover {
    background: #f5f5f5;
    color: #333;
}

.tab.active {
    color: #4CAF50;
    border-bottom-color: #4CAF50;
    font-weight: 600;
}

.tab-icon {
    font-size: 18px;
}

/* Tab Content */
.tab-content {
    display: none;
    background: white;
    padding: 30px;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tab-content.active {
    display: block;
}

.section {
    margin-bottom: 30px;
}

.section h2 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
    font-size: 24px;
}

.section-description {
    color: #666;
    margin-bottom: 20px;
    font-size: 14px;
}

.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 20px;
}

.card {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 24px;
    border: 1px solid #e0e0e0;
}

.card h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
}

/* Forms */
.form {
    width: 100%;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

.form-group .fieldset-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.form-group textarea {
    font-family: 'Monaco', 'Courier New', monospace;
    resize: vertical;
    min-height: 100px;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #999;
    font-size: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin-bottom: 12px;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.checkbox-label:hover {
    background: rgba(0,0,0,0.02);
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

.checkbox-label span {
    user-select: none;
}

.form-group h4 {
    margin: 20px 0 12px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

/* Store Checkboxes */
.store-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
    margin-top: 12px;
    max-height: 400px;
    overflow-y: auto;
    padding: 8px;
}

.store-checkbox {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.store-checkbox:hover {
    border-color: #4CAF50;
    background: #f5f5f5;
}

.store-checkbox input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
    cursor: pointer;
}

.store-checkbox.selected {
    border-color: #4CAF50;
    background: #e8f5e9;
}

.store-info {
    flex: 1;
}

.store-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.store-domain {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #4CAF50;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #45a049;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #2196F3;
    color: white;
}

.btn-secondary:hover {
    background: #0b7dda;
}

.btn-large {
    padding: 14px 28px;
    font-size: 16px;
    width: 100%;
}

.btn-icon {
    margin-right: 8px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Stores List */
.stores-list {
    max-height: 500px;
    overflow-y: auto;
}

.store-item {
    padding: 16px;
    margin-bottom: 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.store-item-info h4 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 16px;
}

.store-item-info p {
    margin: 0;
    color: #666;
    font-size: 12px;
}

.store-item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-edit-store {
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
}

.btn-edit-store:hover {
    background: #1976D2;
}

.btn-edit-store:active {
    background: #0D47A1;
}

.btn-delete-store {
    background: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
}

.btn-delete-store:hover {
    background: #d32f2f;
}

.btn-delete-store:active {
    background: #b71c1c;
}

/* Edit Store Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.modal-close:hover {
    background: #f5f5f5;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.store-item-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.active {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-badge.inactive {
    background: #ffebee;
    color: #c62828;
}

/* Results Container */
.results-container {
    margin-top: 30px;
    padding: 24px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.results-container h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
}

.results-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.summary-card {
    padding: 16px;
    background: white;
    border-radius: 6px;
    text-align: center;
    border: 1px solid #e0e0e0;
}

.summary-number {
    font-size: 32px;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.summary-number.success {
    color: #4CAF50;
}

.summary-number.failed {
    color: #f44336;
}

.summary-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 600px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
    /* Smooth scrolling */
    scroll-behavior: smooth;
}

/* Custom scrollbar styling for better UX */
.results-list::-webkit-scrollbar {
    width: 8px;
}

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

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

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

.result-item {
    padding: 16px;
    border-radius: 6px;
    border-left: 4px solid;
    background: white;
}

.result-item.success {
    border-color: #4CAF50;
    background: #e8f5e9;
}

.result-item.error {
    border-color: #f44336;
    background: #ffebee;
}

.result-item.warning {
    border-color: #ff9800;
    background: #fff3e0;
}

.result-store {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.result-message {
    font-size: 14px;
    color: #666;
}

.result-details {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0,0,0,0.1);
    font-size: 12px;
    color: #999;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #666;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4CAF50;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Status Content */
.status-content {
    margin-top: 20px;
}

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.status-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 6px;
    overflow: hidden;
}

.status-table th,
.status-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.status-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #333;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

/* Warning Box */
.warning-box {
    padding: 16px;
    background: #fff3e0;
    border: 1px solid #ff9800;
    border-radius: 6px;
    margin-bottom: 20px;
    color: #e65100;
    font-size: 14px;
}

.warning-box strong {
    display: block;
    margin-bottom: 5px;
}

/* Progress Bar */
.progress-container {
    margin-top: 20px;
    display: none;
}

.progress-container.active {
    display: block;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: #4CAF50;
    transition: width 0.3s;
    width: 0%;
}

.progress-text {
    text-align: center;
    color: #666;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .multi-store-wrapper {
        padding: 10px;
    }

    .multi-store-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .section-grid {
        grid-template-columns: 1fr;
    }

    .tabs {
        overflow-x: scroll;
    }

    .tab {
        padding: 12px 16px;
        font-size: 12px;
    }

    .store-checkboxes {
        grid-template-columns: 1fr;
    }
}

/* Collection Checkboxes */
.collection-checkbox {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    margin-bottom: 8px;
}

.collection-checkbox:hover {
    border-color: #4CAF50;
    background: #f5f5f5;
}

.collection-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    cursor: pointer;
    flex-shrink: 0;
}

.collection-checkbox.selected {
    border-color: #4CAF50;
    background: #e8f5e9;
}

#collectionsListContainer {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    background: #f9f9f9;
}

#collectionsListContainer::-webkit-scrollbar {
    width: 8px;
}

#collectionsListContainer::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#collectionsListContainer::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

#collectionsListContainer::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Sync Progress Display */
.sync-progress-container {
    padding: 30px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.progress-info h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 20px;
}

.progress-bar-container {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 20px;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50 0%, #45a049 100%);
    border-radius: 15px;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
    min-width: 0;
    position: relative;
    overflow: hidden;
}

.progress-bar span {
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.progress-details {
    margin-top: 20px;
}

.progress-details p {
    margin: 8px 0;
    color: #666;
    font-size: 14px;
}

.progress-details #progress-status {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.progress-details #progress-current {
    color: #4CAF50;
    font-weight: 500;
}

.progress-stats {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.progress-stats span {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
}

.success-count {
    background: #e8f5e9;
    color: #2e7d32;
}

.error-count {
    background: #ffebee;
    color: #c62828;
}

