/* ==========================================================================
   HUB MANAGEMENT VIEW - ProxWide (Modernized)
   ========================================================================== */

.news-rss-view {
    padding: 20px 0;
    max-width: 1400px;
    margin: 0 auto;
    color: var(--text-main);
}

.news-hub-select-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 15px;
    backdrop-filter: blur(10px);
}

.news-hub-select-container label {
    white-space: nowrap;
    font-weight: 600;
    color: var(--text-main);
}

.news-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
}

/* --- Cards --- */
.news-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform var(--trans-base);
}

.news-card:hover {
    
    box-shadow: var(--shadow-lg);
}

.news-card-header {
    padding: 15px 20px;
    background: var(--bg-body-secondary);
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.news-card-header h2 {
    font-size: 1.1rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.news-card-body {
    padding: 20px;
    flex-grow: 1;
}

/* --- Controls --- */
.news-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    color: var(--text-main);
    background-color: var(--bg-input);
    transition: all var(--trans-fast);
    margin-bottom: 15px;
}

.news-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    outline: none;
}

.news-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

/* --- Buttons --- */
.news-btn {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--trans-fast);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.news-btn:active {
    transform: scale(0.98);
}

.news-btn-primary {
    background: var(--primary);
    color: white;
}

.news-btn-primary:hover {
    background: var(--primary-hover);
}

.news-btn-success {
    background: var(--success);
    color: white;
}

.news-btn-success:hover {
    opacity: 0.9;
}

.news-btn-danger {
    background: var(--danger);
    color: white;
}

.news-btn-danger:hover {
    opacity: 0.9;
}

/* --- Indicators / Stats --- */
.news-stat-card {
    background: linear-gradient(135deg, var(--primary-light) 0%, rgba(var(--primary-rgb), 0.05) 100%);
    border: 1px solid var(--primary-light);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 10px;
}

.stat-main-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    display: block;
    text-shadow: 0 0 20px var(--primary-light);
}

.stat-subtext {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 6px;
    display: block;
}

.stat-icon-bg {
    font-size: 3rem;
    color: var(--primary);
    opacity: 0.1;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

.news-badge-dynamic {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid var(--primary-light);
    font-size: 0.7rem;
    padding: 4px 12px;
    letter-spacing: 0.5px;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* --- Inputs with Icons --- */
.input-with-icon {
    position: relative;
}

.input-prefix {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 1.2rem;
    z-index: 5;
}

.news-input-premium {
    padding-left: 48px !important;
}

/* --- News List --- */
.news-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
    transition: background var(--trans-fast);
}

.news-list-item:hover {
    background: var(--bg-body);
}

.news-list-item:last-child {
    border-bottom: none;
}

/* --- Responsive --- */
@media (max-width: 992px) {
    .news-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .news-hub-select-container {
        flex-direction: column;
        align-items: stretch;
    }

    .news-hub-select-container select {
        max-width: none;
    }
}

/* Utilities */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==========================================================================
   IMPORT MODAL
   ========================================================================== */

.import-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.import-modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
}

.import-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.import-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
}

.btn-close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: all var(--trans-fast);
}

.btn-close-modal:hover {
    background: var(--bg-body-secondary);
    color: var(--text-main);
}

/* Step Indicator */
.import-steps {
    display: flex;
    padding: 16px 24px;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-body-secondary);
}

.import-steps .step {
    flex: 1;
    text-align: center;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    transition: all var(--trans-fast);
}

.import-steps .step.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.import-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.import-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    align-items: center;
    background: var(--bg-body-secondary);
}

/* Input Mode Toggle */
.input-mode-toggle {
    display: flex;
    gap: 8px;
    background: var(--bg-body-secondary);
    padding: 4px;
    border-radius: var(--radius-md);
    width: fit-content;
}

.toggle-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all var(--trans-fast);
}

.toggle-btn.active {
    background: white;
    color: var(--text-main);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .toggle-btn.active {
    background: var(--bg-card);
}

/* CSV Textarea */
.csv-textarea {
    width: 100%;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: monospace;
    font-size: 0.9rem;
    resize: vertical;
    background: var(--bg-input);
    color: var(--text-main);
    min-height: 200px;
}

.csv-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* File Input */
.file-input {
    display: block;
    width: 100%;
    padding: 12px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-body-secondary);
    cursor: pointer;
}

.file-selected {
    margin-top: 12px;
    padding: 12px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-weight: 500;
}

/* Format Help */
.format-help {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-body-secondary);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Mapping Section */
.mapping-section h4 {
    font-size: 1rem;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
}

.mapping-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mapping-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-body-secondary);
    border-radius: var(--radius-md);
}

.mapping-name {
    font-weight: 600;
    min-width: 150px;
    color: var(--text-main);
}

.mapping-row i {
    color: var(--text-muted);
}

.mapping-select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-main);
    font-size: 0.9rem;
}

.mapping-select.is-invalid {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.05);
}

/* Parse Errors */
.parse-errors,
.import-errors {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    padding: 16px;
}

.parse-errors h5,
.import-errors h5 {
    margin: 0 0 12px 0;
    color: var(--danger);
    display: flex;
    align-items: center;
    gap: 8px;
}

.parse-errors ul,
.import-errors ul {
    margin: 0;
    padding-left: 20px;
    font-size: 0.85rem;
    color: var(--danger);
}

/* Preview Table */
.preview-section h5 {
    margin: 0 0 12px 0;
    color: var(--text-main);
}

.preview-table-container {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.preview-table th {
    background: var(--bg-body-secondary);
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.preview-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.preview-table tr:last-child td {
    border-bottom: none;
}

/* Results Summary */
.results-summary {
    display: flex;
    gap: 20px;
    justify-content: center;
    padding: 24px;
}

.result-stat {
    text-align: center;
    padding: 24px 40px;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.result-stat.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.result-stat.success i,
.result-stat.success .stat-number {
    color: var(--success);
}

.result-stat.warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.result-stat.warning i,
.result-stat.warning .stat-number {
    color: #d97706;
}

.result-stat i {
    font-size: 2rem;
}

.result-stat .stat-number {
    font-size: 2.5rem;
    font-weight: 800;
}

.result-stat .stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Spinner */
.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Button Secondary */
.news-btn-secondary {
    background: var(--bg-body-secondary);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.news-btn-secondary:hover {
    background: var(--bg-body);
}

/* Responsive */
@media (max-width: 600px) {
    .import-modal {
        max-height: 95vh;
    }

    .mapping-row {
        flex-direction: column;
        align-items: stretch;
    }

    .mapping-name {
        min-width: auto;
    }

    .results-summary {
        flex-direction: column;
    }
}
