/* DataHub - Manage Imports Page Styles */

/* ============================================================================
   PAGE HEADER
   ============================================================================ */

.manage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.manage-header .page-title {
    margin: 0;
}

/* ============================================================================
   FILTERS
   ============================================================================ */

.manage-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 150px;
}

.filter-group label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    font-weight: 700;
}

.filter-group select,
.filter-group input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

/* ============================================================================
   IMPORTS LIST
   ============================================================================ */

.imports-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ============================================================================
   PAGINATION
   ============================================================================ */

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.pagination-meta {
    font-size: 0.9rem;
    color: var(--muted);
}

/* ============================================================================
   IMPORT ITEM (Card Style)
   ============================================================================ */

.import-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: box-shadow 0.2s, border-color 0.2s;
}

.import-item:hover {
    border-color: var(--muted-light);
    box-shadow: var(--shadow-sm);
}

/* ============================================================================
   IMPORT ICON
   ============================================================================ */

.import-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: white;
    flex-shrink: 0;
    font-family: 'Manrope', sans-serif;
    letter-spacing: 0.02em;
}

/* Source icon colors */
.import-icon.sw {
    background: #3b82f6;
}

.import-icon.st {
    background: #8b5cf6;
}

.import-icon.gt {
    background: #ea4335;
}

.import-icon.dump {
    background: #f59e0b;
}

.import-icon.va {
    background: #0ea5e9;
}

/* ============================================================================
   IMPORT INFO
   ============================================================================ */

.import-info {
    flex: 1;
    min-width: 0;
}

.import-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    margin: 0 0 4px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.import-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--muted);
}

.import-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.import-meta .import-status {
    color: var(--primary);
}

.import-meta .import-status a {
    color: inherit;
}

.import-meta .import-status.status-error {
    color: var(--accent-red);
}

.import-meta .import-status.status-loading {
    color: var(--muted);
}

/* ============================================================================
   IMPORT ACTIONS
   ============================================================================ */

.import-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.btn-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.btn-edit:hover {
    background: var(--border-light);
    color: var(--text);
}

.btn-delete {
    border-color: var(--accent-red);
    color: var(--accent-red-text);
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.08);
    color: var(--accent-red-text);
}

/* ============================================================================
   BUTTON STYLES
   ============================================================================ */

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.btn-secondary:hover {
    background: var(--border-light);
    color: var(--text);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--accent-red);
    color: white;
    border: 1px solid var(--accent-red);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.btn-danger:hover {
    background: var(--accent-red-text);
    border-color: var(--accent-red-text);
}

.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================================
   LOADING STATE
   ============================================================================ */

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    color: var(--muted);
}

.loading-state::before {
    content: '';
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-state-text {
    font-size: 0.9rem;
    font-weight: 500;
}

/* ============================================================================
   EMPTY STATE
   ============================================================================ */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    text-align: center;
    color: var(--muted);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    background: var(--border-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.empty-state-title {
    font-family: 'Manrope', 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 8px 0;
}

.empty-state-message {
    font-size: 0.9rem;
    color: var(--muted);
    margin: 0 0 16px 0;
    max-width: 400px;
}

/* ============================================================================
   MODAL STYLES
   ============================================================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    z-index: 1001;
    margin: 20px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-family: 'Manrope', 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: var(--text);
}

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--muted);
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    transition: all 0.15s;
}

.modal-close:hover {
    background: var(--border-light);
    color: var(--text);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ============================================================================
   FORM STYLES (Reusable from import.css patterns)
   ============================================================================ */

.form-group {
    margin-bottom: 16px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--muted-light);
}

.form-textarea {
    min-height: 80px;
    resize: vertical;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 4px;
}

.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.form-row > .form-group {
    flex: 1;
    min-width: 200px;
}

/* ============================================================================
   CHECKBOX GROUP
   ============================================================================ */

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.checkbox-group label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* ============================================================================
   DELETE CONFIRMATION STYLES
   ============================================================================ */

.delete-confirm-message {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 16px;
    color: #991b1b;
    font-size: 0.9rem;
}

.delete-confirm-message strong {
    display: block;
    margin-bottom: 4px;
}

/* ============================================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================================ */

@media (max-width: 768px) {
    .manage-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .manage-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        min-width: 100%;
    }

    .import-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .import-info {
        width: 100%;
    }

    .import-name {
        white-space: normal;
    }

    .import-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .modal-content {
        margin: 10px;
        max-height: calc(100vh - 20px);
    }

    .modal-footer {
        flex-direction: column-reverse;
        gap: 8px;
    }

    .modal-footer button {
        width: 100%;
    }

    .form-row {
        flex-direction: column;
    }

    .form-row > .form-group {
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    .import-meta {
        flex-direction: column;
        gap: 4px;
    }
}
