/* Citations Page Styles */

/* Toolbar with date selector and auto-replicate button */
.citations-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
}

.date-range-selector {
    display: inline-flex;
    gap: 4px;
    background: rgba(17, 24, 39, 0.5);
    border: 1px solid var(--gray-800);
    border-radius: 8px;
    padding: 4px;
}

.date-btn {
    padding: 6px 14px;
    border: none;
    background: transparent;
    color: var(--gray-400);
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.date-btn:hover {
    color: #fff;
}

.date-btn.active {
    background: var(--red-500);
    color: #fff;
}

/* Stats - Horizontal compact cards - Dashboard theme (solid dark) */
.citations-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    margin-bottom: 24px;
    background: var(--gray-800);
    border-radius: 12px;
    overflow: hidden;
}

.citation-stat-card {
    background: rgba(17, 24, 39, 0.8);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: background 0.2s ease;
}

.citation-stat-card:hover {
    background: rgba(17, 24, 39, 0.95);
}

.citation-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--red-500);
    flex-shrink: 0;
}

.citation-stat-icon.corporate {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.citation-stat-icon.news {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.citation-stat-icon.review {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.citation-stat-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.citation-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.citation-stat-label {
    font-size: 12px;
    color: var(--gray-500);
}

@media (max-width: 1200px) {
    .citations-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .citations-stats {
        grid-template-columns: 1fr;
    }

    .citations-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .citations-toolbar .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Filters - Dashboard theme (solid dark) */
.citations-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    align-items: center;
    padding: 14px 16px;
    background: rgba(17, 24, 39, 0.5);
    border: 1px solid var(--gray-800);
    border-radius: 10px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-500);
}

.filter-select {
    padding: 8px 28px 8px 12px;
    background: var(--gray-900);
    border: 1px solid var(--gray-700);
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.filter-select:focus {
    outline: none;
    border-color: var(--red-500);
}

.search-group {
    flex: 1;
    min-width: 180px;
    max-width: 280px;
    position: relative;
    margin-left: auto;
}

.search-group svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-500);
}

.search-input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    background: var(--gray-900);
    border: 1px solid var(--gray-700);
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
}

.search-input::placeholder {
    color: var(--gray-500);
}

.search-input:focus {
    outline: none;
    border-color: var(--red-500);
}

/* Loading State */
.citations-loading {
    text-align: center;
    padding: 80px 24px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--gray-800);
    border-top-color: var(--red-500);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.citations-loading p {
    color: var(--gray-400);
}

/* Empty State */
.citations-empty {
    text-align: center;
    padding: 80px 24px;
}

.citations-empty svg {
    color: var(--gray-600);
    margin-bottom: 24px;
}

.citations-empty h3 {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.citations-empty p {
    color: var(--gray-400);
    margin-bottom: 24px;
}

/* Table - Dashboard theme (solid dark) */
.citations-table-wrapper {
    background: rgba(17, 24, 39, 0.5);
    border: 1px solid var(--gray-800);
    border-radius: 12px;
    overflow: hidden;
}

.citations-table {
    width: 100%;
    border-collapse: collapse;
}

.citations-table th {
    text-align: left;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.3);
    color: var(--gray-400);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--gray-800);
}

.citations-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.citations-table th.sortable:hover {
    color: #fff;
}

.citations-table th.sortable svg {
    opacity: 0.5;
    vertical-align: middle;
    margin-left: 4px;
}

.citations-table th.sortable.asc svg path:first-child,
.citations-table th.sortable.desc svg path:last-child {
    opacity: 0.3;
}

.citations-table th.sortable.asc svg,
.citations-table th.sortable.desc svg {
    opacity: 1;
    color: var(--red-500);
}

.citations-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-800);
    color: var(--gray-300);
    font-size: 14px;
}

.citations-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.citations-table tbody tr:last-child td {
    border-bottom: none;
}

/* Source Cell */
.source-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 350px;
}

.source-title {
    color: #fff;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.source-url {
    color: var(--gray-500);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Type Badge */
.type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.type-badge.corporate {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.type-badge.news {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.type-badge.review {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.type-badge.forum {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
}

.type-badge.social {
    background: rgba(236, 72, 153, 0.1);
    color: #ec4899;
}

.type-badge.documentation {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

/* Provider Pills */
.provider-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.provider-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    color: #fff;
}

/* Appearances */
.appearances-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 4px 8px;
    background: rgba(239, 68, 68, 0.1);
    color: var(--red-500);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}

/* Date */
.date-cell {
    color: var(--gray-500);
    font-size: 13px;
}

/* Action Button */
.visit-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--gray-700);
    border-radius: 6px;
    color: var(--gray-400);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.visit-btn:hover {
    border-color: var(--red-500);
    color: var(--red-500);
}

/* Pagination */
.citations-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(17, 24, 39, 0.8);
    border: 1px solid var(--gray-700);
    border-radius: 8px;
    color: var(--gray-400);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--red-500);
    color: var(--red-500);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    color: var(--gray-500);
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .citations-header {
        flex-direction: column;
    }

    .date-range-selector {
        width: 100%;
        justify-content: center;
    }

    .citations-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        flex: 1;
    }

    .search-group {
        max-width: none;
        margin-left: 0;
    }

    .citations-table-wrapper {
        overflow-x: auto;
    }

    .citations-table {
        min-width: 800px;
    }
}

/* ========================================
   Modal Styles
======================================== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

/* Override for replicate modal - more specific to beat content-planner.css */
#replicateModal.modal {
    z-index: 10000;
}

#replicateModal .modal-overlay {
    position: absolute !important;
    z-index: 1 !important;
}

#replicateModal .modal-content {
    z-index: 2;
}

.modal-content {
    position: relative;
    z-index: 10;
    background: var(--gray-900);
    border: 1px solid var(--gray-800);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-content.modal-large {
    max-width: 700px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-800);
}

.modal-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #fff;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid var(--gray-800);
}

/* Form Styles */
.form-section {
    margin-bottom: 24px;
}

.form-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-300);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-300);
    margin-bottom: 6px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--gray-800);
    border: 1px solid var(--gray-700);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--red-500);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--gray-500);
}

.form-textarea {
    resize: vertical;
    min-height: 60px;
}

.form-select {
    cursor: pointer;
}

.checkbox-group {
    margin-top: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--gray-300);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--red-500);
}

/* Source Info Card (for Replicate Modal) */
.source-info-card {
    background: var(--gray-800);
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 20px;
    border: 1px solid var(--gray-700);
}

.source-info-card .source-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    margin-bottom: 6px;
}

.source-info-card h4 {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.source-info-card .source-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--red-400);
    text-decoration: none;
}

.source-info-card .source-link:hover {
    color: var(--red-300);
    text-decoration: underline;
}

/* Form Section Headers */
.form-section h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-300);
    margin: 0 0 14px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Form Hint */
.form-hint {
    display: block;
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* Article Preview Card */
.article-preview {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-800);
}

.article-preview h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-300);
    margin: 0 0 14px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preview-card {
    background: var(--gray-800);
    border-radius: 10px;
    padding: 20px;
    max-height: 350px;
    overflow-y: auto;
}

.preview-card .preview-image {
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 16px;
}

.preview-card .preview-title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.preview-card .preview-excerpt {
    font-size: 14px;
    color: var(--gray-400);
    font-style: italic;
    margin: 0 0 16px 0;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-700);
    line-height: 1.5;
}

.preview-card .preview-content {
    font-size: 14px;
    color: var(--gray-300);
    line-height: 1.7;
}

.preview-card .preview-content h2,
.preview-card .preview-content h3 {
    color: #fff;
    margin: 20px 0 10px 0;
}

.preview-card .preview-content p {
    margin: 0 0 12px 0;
}

.preview-card .preview-content ul,
.preview-card .preview-content ol {
    margin: 0 0 12px 0;
    padding-left: 24px;
}

/* Source Preview */
.source-preview {
    background: var(--gray-800);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}

.source-preview h4 {
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-500);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.source-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.source-info .source-title {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.source-info .source-url {
    font-size: 13px;
    color: var(--red-400);
    flex-shrink: 0;
}

/* Article Preview */
.article-preview-content {
    background: var(--gray-800);
    border-radius: 8px;
    padding: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.preview-header {
    margin-bottom: 16px;
}

.preview-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 12px;
}

.preview-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.preview-excerpt {
    font-size: 14px;
    color: var(--gray-400);
    font-style: italic;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-700);
}

.preview-content {
    font-size: 14px;
    color: var(--gray-300);
    line-height: 1.6;
}

.preview-content h2,
.preview-content h3 {
    color: #fff;
    margin-top: 16px;
    margin-bottom: 8px;
}

.preview-content p {
    margin-bottom: 12px;
}

/* WordPress Setup Steps */
.wp-setup-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.setup-step {
    display: flex;
    gap: 16px;
}

.step-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--red-500);
    color: #fff;
    font-weight: 600;
    border-radius: 50%;
    font-size: 14px;
}

.step-content h4 {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.step-content p {
    font-size: 13px;
    color: var(--gray-400);
    margin-bottom: 12px;
}

/* License Key Box */
.license-key-box {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.license-key-display {
    flex: 1;
    min-width: 200px;
    padding: 10px 14px;
    background: var(--gray-800);
    border: 1px solid var(--gray-700);
    border-radius: 8px;
    font-family: monospace;
    font-size: 13px;
}

.license-key-display .no-key {
    color: var(--gray-500);
}

.license-key-display .key {
    color: var(--green-400);
    word-break: break-all;
}

/* Connected Sites */
.connected-sites {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-800);
}

.connected-sites h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-300);
    margin-bottom: 12px;
}

.sites-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.site-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--gray-800);
    border-radius: 8px;
}

.site-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.site-name {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
}

.site-url-text {
    font-size: 12px;
    color: var(--gray-500);
}

.site-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--green-400);
}

.site-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--green-400);
    border-radius: 50%;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}

.btn-primary {
    background: var(--red-500);
    color: #fff;
}

.btn-primary:hover {
    background: var(--red-600);
}

.btn-primary:disabled {
    background: var(--gray-600);
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--gray-700);
    color: var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-600);
}

.btn-success {
    background: #22c55e;
    color: #fff;
}

.btn-success:hover {
    background: #16a34a;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-600);
    color: var(--gray-300);
}

.btn-outline:hover {
    border-color: var(--red-500);
    color: var(--red-400);
}

/* WordPress Site Selector */
#wpSiteSelector {
    min-height: 60px;
}

#wpSiteSelector .loading-text {
    color: var(--gray-500);
    font-size: 14px;
}

.wp-site-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--gray-800);
    border: 2px solid var(--gray-700);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s;
    margin-bottom: 8px;
}

.wp-site-option:hover {
    border-color: var(--gray-600);
}

.wp-site-option.selected {
    border-color: var(--red-500);
    background: rgba(239, 68, 68, 0.1);
}

.wp-site-option input[type="radio"] {
    display: none;
}

.wp-site-option .radio-indicator {
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-500);
    border-radius: 50%;
    position: relative;
}

.wp-site-option.selected .radio-indicator {
    border-color: var(--red-500);
}

.wp-site-option.selected .radio-indicator::after {
    content: '';
    position: absolute;
    inset: 3px;
    background: var(--red-500);
    border-radius: 50%;
}

.wp-site-label {
    flex: 1;
}

.wp-site-label .site-name {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
}

.wp-site-label .site-url-text {
    font-size: 12px;
    color: var(--gray-500);
}

.no-sites-message {
    text-align: center;
    padding: 20px;
    background: var(--gray-800);
    border-radius: 8px;
}

.no-sites-message p {
    color: var(--gray-400);
    margin-bottom: 12px;
    font-size: 14px;
}

.no-sites-message .no-wp-icon {
    width: 56px;
    height: 56px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: var(--red-400);
}

/* WordPress Connected Site Display */
.wp-connected-site {
    background: var(--gray-800);
    border-radius: 10px;
    padding: 16px;
    border: 1px solid var(--gray-700);
}

.wp-site-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wp-site-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #21759b 0%, #1e6a8d 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.wp-site-details {
    flex: 1;
    min-width: 0;
}

.wp-site-name {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.wp-site-url {
    display: block;
    font-size: 13px;
    color: var(--gray-400);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wp-connected-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    flex-shrink: 0;
}

/* Replicate Button in Table */
.btn-replicate {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--red-500);
    color: var(--red-400);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-replicate:hover {
    background: var(--red-500);
    color: #fff;
}

/* Pro Locked State */
.btn-replicate.btn-pro-locked {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.5);
    color: rgba(245, 158, 11, 0.8);
    position: relative;
}

.btn-replicate.btn-pro-locked:hover {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.btn-replicate .pro-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 5px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #000;
    font-size: 9px;
    font-weight: 700;
    border-radius: 3px;
    margin-left: 6px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Loading State */
.generating-state {
    text-align: center;
    padding: 40px;
}

.generating-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-700);
    border-top-color: var(--red-500);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

.generating-state p {
    color: var(--gray-400);
    font-size: 14px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Published Citations Indicators */
.published-row {
    background: rgba(34, 197, 94, 0.05);
}

.published-row:hover {
    background: rgba(34, 197, 94, 0.1);
}

.published-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.published-badge svg {
    flex-shrink: 0;
}

.view-post-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.view-post-btn:hover {
    background: rgba(34, 197, 94, 0.2);
    transform: translateY(-1px);
}

/* ========================================
   Auto-Replicate Styles
======================================== */

/* Header Button */
.citations-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

#autoReplicateBtn {
    white-space: nowrap;
}

#autoReplicateBtn.active {
    background: rgba(34, 197, 94, 0.15);
    border-color: #22c55e;
    color: #22c55e;
}

/* Only spin when actively processing, not just when enabled */
#autoReplicateBtn.active.processing svg {
    animation: spin 2s linear infinite;
}

/* Auto-Replicate Status */
.auto-replicate-status {
    margin-bottom: 20px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: var(--gray-800);
    border-radius: 10px;
    border: 1px solid var(--gray-700);
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.inactive {
    background: var(--gray-500);
}

.status-dot.active {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
    animation: pulse-green 2s ease-in-out infinite;
}

@keyframes pulse-green {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.status-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-300);
}

.status-indicator.active .status-text {
    color: #22c55e;
}

/* Modal Description */
.modal-description {
    color: var(--gray-400);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 24px;
    padding: 14px 16px;
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 8px;
}

/* Form Help Text */
.form-help {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 6px;
}

/* Queue Stats */
.queue-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.queue-stat {
    text-align: center;
    padding: 14px 10px;
    background: var(--gray-800);
    border-radius: 8px;
    border: 1px solid var(--gray-700);
}

.queue-stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.queue-stat-label {
    font-size: 11px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Danger Button */
.btn-danger {
    background: #dc2626;
    color: #fff;
}

.btn-danger:hover {
    background: #b91c1c;
}

/* Modal Small Size */
.modal-content.modal-small {
    max-width: 450px;
}

/* Queue Progress */
.queue-progress {
    margin-bottom: 20px;
}

.queue-progress-bar {
    height: 8px;
    background: var(--gray-800);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.queue-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--red-500), var(--red-400));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.queue-progress-text {
    font-size: 14px;
    color: var(--gray-400);
    text-align: center;
}

/* Queue Current Item */
.queue-current-item {
    padding: 16px;
    background: var(--gray-800);
    border-radius: 8px;
    margin-bottom: 16px;
}

.current-label {
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 6px;
}

.current-title {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Queue Log */
.queue-log {
    max-height: 150px;
    overflow-y: auto;
    background: var(--gray-800);
    border-radius: 8px;
    padding: 12px;
}

.queue-log-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-700);
    font-size: 13px;
}

.queue-log-item:last-child {
    border-bottom: none;
}

.queue-log-item .log-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.queue-log-item.success .log-icon {
    color: #22c55e;
}

.queue-log-item.error .log-icon {
    color: #ef4444;
}

.queue-log-item.processing .log-icon {
    color: #f59e0b;
    animation: spin 1s linear infinite;
}

.queue-log-item .log-text {
    color: var(--gray-300);
    flex: 1;
}

.queue-log-item .log-time {
    color: var(--gray-500);
    font-size: 11px;
    flex-shrink: 0;
}

/* Spinning animation for icons */
.spinning {
    animation: spin 1.5s linear infinite;
}

/* Citation Status Indicators */
.citation-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.status-badge.queued {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.status-badge.processing {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.status-badge.failed {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.status-badge.skipped {
    background: rgba(107, 114, 128, 0.15);
    color: #9ca3af;
}

/* Invalid Domain Badge */
.invalid-domain-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(107, 114, 128, 0.15);
    color: #9ca3af;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.invalid-domain-badge svg {
    width: 12px;
    height: 12px;
}

/* Failed Row Styling */
.failed-row {
    background: rgba(239, 68, 68, 0.05);
}

.failed-row:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Responsive Queue Stats */
@media (max-width: 480px) {
    .queue-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .citations-header-right {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    #autoReplicateBtn {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   Enabled Banner (Waiting for Citations)
======================================== */

.enabled-banner {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(34, 197, 94, 0.05) 100%);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 12px;
    margin-bottom: 24px;
}

.enabled-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    gap: 20px;
}

.enabled-banner-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.enabled-pulse {
    width: 12px;
    height: 12px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
    animation: pulse-green 2s ease-in-out infinite;
}

.enabled-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.enabled-title {
    font-size: 14px;
    font-weight: 600;
    color: #22c55e;
}

.enabled-status {
    font-size: 12px;
    color: var(--gray-400);
}

.enabled-banner-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .enabled-banner-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .enabled-banner-right {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ========================================
   Processing Banner (Background Status)
======================================== */

.processing-banner {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(245, 158, 11, 0.1) 100%);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    margin-bottom: 24px;
    overflow: hidden;
}

.processing-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    gap: 20px;
}

.processing-banner-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.processing-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(239, 68, 68, 0.2);
    border-top-color: #ef4444;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.processing-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.processing-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.processing-status {
    font-size: 12px;
    color: var(--gray-400);
}

.processing-banner-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.processing-stats {
    display: flex;
    gap: 16px;
}

.processing-stat {
    font-size: 13px;
    color: var(--gray-300);
}

.processing-stat span {
    font-weight: 600;
    color: #fff;
}

.processing-progress {
    height: 4px;
    background: rgba(0, 0, 0, 0.3);
}

.processing-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444, #f59e0b);
    transition: width 0.5s ease;
}

/* Processing Complete State */
.processing-banner.complete {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(34, 197, 94, 0.05) 100%);
    border-color: rgba(34, 197, 94, 0.3);
}

.processing-banner.complete .processing-spinner {
    display: none;
}

.processing-banner.complete .processing-title::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    background: #22c55e;
    border-radius: 50%;
    margin-right: 10px;
    vertical-align: middle;
}

.processing-banner.complete .processing-progress-fill {
    background: #22c55e;
}

/* Responsive */
@media (max-width: 768px) {
    .processing-banner-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .processing-banner-right {
        width: 100%;
        justify-content: space-between;
    }

    .processing-stats {
        flex-wrap: wrap;
        gap: 10px;
    }
}

/* =====================================================
   AUTO-REPLICATE MODAL
===================================================== */

.auto-replicate-modal {
    max-width: 520px;
    width: 100%;
}

.auto-replicate-modal .modal-body {
    padding: 0;
}

/* WordPress Check Section */
.wp-check-section {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-800);
    background: rgba(17, 24, 39, 0.5);
}

.wp-check-section .loading-text {
    color: var(--gray-400);
    font-size: 14px;
    margin: 0;
}

.wp-check-section.connected {
    background: rgba(34, 197, 94, 0.1);
    border-bottom-color: rgba(34, 197, 94, 0.2);
}

.wp-check-section.not-connected {
    background: rgba(239, 68, 68, 0.1);
    border-bottom-color: rgba(239, 68, 68, 0.2);
}

.wp-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wp-status-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wp-status-icon.connected {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.wp-status-icon.not-connected {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.wp-status-info h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.wp-status-info p {
    margin: 0;
    font-size: 13px;
    color: var(--gray-400);
}

.wp-status-info a {
    color: var(--red-400);
    text-decoration: none;
}

.wp-status-info a:hover {
    text-decoration: underline;
}

/* Queue Status Section */
.queue-status-section {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-800);
}

.queue-status-section h3 {
    margin: 0 0 16px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-300);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.queue-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.queue-stat {
    text-align: center;
    padding: 12px 8px;
    background: rgba(17, 24, 39, 0.5);
    border-radius: 8px;
    border: 1px solid var(--gray-800);
}

.queue-stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    margin-bottom: 4px;
}

.queue-stat-label {
    font-size: 11px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.queue-actions {
    display: flex;
    gap: 8px;
}

/* Auto-Replicate Settings */
.auto-replicate-settings {
    padding: 20px 24px;
}

.auto-replicate-settings h3 {
    margin: 0 0 16px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-300);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auto-replicate-settings .form-group {
    margin-bottom: 20px;
}

.auto-replicate-settings .form-group:last-child {
    margin-bottom: 0;
}

.auto-replicate-settings label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
}

.auto-replicate-settings .form-select {
    width: 100%;
    padding: 10px 12px;
    background: rgba(17, 24, 39, 0.8);
    border: 1px solid var(--gray-700);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.auto-replicate-settings .form-select:focus {
    outline: none;
    border-color: var(--red-500);
}

.auto-replicate-settings .form-help {
    margin: 8px 0 0 0;
    font-size: 12px;
    color: var(--gray-500);
}

.auto-replicate-settings .checkbox-group {
    margin-bottom: 16px;
}

.auto-replicate-settings .checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 0;
}

.auto-replicate-settings .checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--red-500);
    cursor: pointer;
}

.auto-replicate-settings .checkbox-label span {
    font-size: 14px;
    color: #fff;
}

/* Modal Footer Buttons */
.auto-replicate-modal .modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-800);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.auto-replicate-modal .modal-footer .btn {
    min-width: 120px;
}

/* Toggle Button States */
#toggleAutoReplicate.enabled {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--red-500);
    color: var(--red-400);
}

#toggleAutoReplicate.enabled:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* Responsive Modal */
@media (max-width: 640px) {
    .auto-replicate-modal {
        margin: 16px;
        max-height: calc(100vh - 32px);
    }

    .queue-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .auto-replicate-modal .modal-footer {
        flex-direction: column;
    }

    .auto-replicate-modal .modal-footer .btn {
        width: 100%;
    }
}

/* =====================================================
   REPLICATE CREDITS STYLES
   ===================================================== */

/* Credit badge in modal header */
.credit-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
    padding: 4px 10px;
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: #fbbf24;
    vertical-align: middle;
}

.credit-badge svg {
    opacity: 0.8;
}

/* No credits state in replicate modal */
#noReplicateCreditsState {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    text-align: center;
}

#noReplicateCreditsState .no-credits-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 24px;
    background: rgba(251, 191, 36, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#noReplicateCreditsState .no-credits-icon svg {
    color: #fbbf24;
}

#noReplicateCreditsState h3 {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 12px;
}

#noReplicateCreditsState p {
    font-size: 14px;
    color: var(--gray-400);
    margin: 0 0 8px;
    max-width: 320px;
}

#noReplicateCreditsState .credit-reset-info {
    color: var(--gray-300);
    margin-bottom: 24px;
}

#noReplicateCreditsState .credit-reset-info strong {
    color: #fbbf24;
}

#noReplicateCreditsState .btn {
    margin-top: 8px;
}
