/* Bulk Generate Tab Styles */

/* Card Titles */
.aifi-bulk-card-title {
    background: #f8f9fa;
    margin: 0;
    padding: 18px 28px;
    font-size: 15px;
    font-weight: 600;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 10px;
}
.aifi-bulk-card-title .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #667eea;
}
.aifi-bulk-count {
    font-size: 13px;
    font-weight: 400;
    color: #6b7280;
    margin-left: auto;
}

/* Filters */
.aifi-bulk-filters {
    padding: 28px;
}

/* Filter Grid: 3 columns, auto-fills rows */
.aifi-bulk-filter-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px 24px;
}

.aifi-bulk-filter-group {
    min-width: 0;
}
.aifi-bulk-filter-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 13px;
    color: #374151;
    line-height: 1.4;
}
.aifi-bulk-select,
.aifi-bulk-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
    height: 40px;
}
.aifi-bulk-select:focus,
.aifi-bulk-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
    outline: none;
}

/* Options Row */
.aifi-bulk-options-row {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f3f4f6;
}

.aifi-bulk-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    line-height: 1.4;
}
.aifi-bulk-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    flex-shrink: 0;
}

/* Filter Actions */
.aifi-bulk-filter-actions {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f3f4f6;
}
.aifi-bulk-load-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 8px 24px !important;
    font-size: 14px !important;
    height: auto !important;
    line-height: 1.5 !important;
}
.aifi-bulk-load-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Legacy filter-row support (keep for non-grid sections if any) */
.aifi-bulk-filter-row {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
}
.aifi-bulk-filter-row:last-child {
    margin-bottom: 0;
}
.aifi-bulk-filter-row > .aifi-bulk-filter-group {
    flex: 1;
    min-width: 0;
}
.aifi-bulk-filter-actions .button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    vertical-align: text-bottom;
    margin-right: 4px;
}

/* Selection limit message (free users) */
.aifi-bulk-select-limit-msg {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
    padding: 10px 28px;
}
.aifi-bulk-select-limit-msg .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #d97706;
    flex-shrink: 0;
}
.aifi-bulk-select-limit-msg a {
    color: #667eea;
    font-weight: 600;
    text-decoration: none;
}
.aifi-bulk-select-limit-msg a:hover {
    text-decoration: underline;
}

/* Posts Table */
.aifi-bulk-posts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    background: #f9fafb;
    border-bottom: 1px solid #f3f4f6;
}
#aifi-bulk-selected-count {
    font-size: 13px;
    color: #6b7280;
}
.aifi-bulk-posts-list {
    max-height: 400px;
    overflow-y: auto;
}
.aifi-bulk-post-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 28px;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s;
}
.aifi-bulk-post-item:hover {
    background: #f9fafb;
}
.aifi-bulk-post-item:last-child {
    border-bottom: none;
}
.aifi-bulk-post-title {
    flex: 1;
    font-size: 14px;
    color: #1f2937;
}
.aifi-bulk-post-date {
    font-size: 12px;
    color: #9ca3af;
    white-space: nowrap;
}
.aifi-bulk-post-thumb {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    white-space: nowrap;
}
.aifi-bulk-post-thumb img {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 4px;
}
.aifi-bulk-post-thumb .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}
.aifi-bulk-no-thumb {
    color: #d97706;
}
.aifi-bulk-has-thumb {
    color: #059669;
}
.aifi-bulk-posts-actions {
    padding: 18px 28px;
    border-top: 1px solid #e5e7eb;
    background: #f8f9fa;
}
.aifi-bulk-posts-actions .button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    vertical-align: text-bottom;
    margin-right: 4px;
}

/* Pagination */
.aifi-bulk-posts-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-top: 1px solid #f3f4f6;
}
.aifi-bulk-posts-pagination:empty {
    display: none;
}
.aifi-bulk-page-btn {
    padding: 4px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
    color: #374151;
}
.aifi-bulk-page-btn:hover {
    background: #f3f4f6;
}
.aifi-bulk-page-btn.active {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}
.aifi-bulk-page-info {
    font-size: 13px;
    color: #6b7280;
}

/* Progress */
.aifi-bulk-progress {
    padding: 28px;
}
.aifi-bulk-progress-text {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 14px;
    color: #374151;
}
.aifi-bulk-progress-bar-wrap {
    height: 20px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 24px;
}
.aifi-bulk-progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: width 0.3s ease;
    min-width: 0;
}

/* Results Log */
.aifi-bulk-results-log {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 16px;
}
.aifi-bulk-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 13px;
    border-bottom: 1px solid #f3f4f6;
}
.aifi-bulk-result-item:last-child {
    border-bottom: none;
}
.aifi-bulk-result-success {
    color: #059669;
}
.aifi-bulk-result-success .dashicons {
    color: #059669;
}
.aifi-bulk-result-skipped {
    color: #d97706;
}
.aifi-bulk-result-skipped .dashicons {
    color: #d97706;
}
.aifi-bulk-result-error {
    color: #dc2626;
}
.aifi-bulk-result-error .dashicons {
    color: #dc2626;
}
.aifi-bulk-result-item .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.aifi-bulk-result-title {
    font-weight: 500;
    flex-shrink: 0;
}
.aifi-bulk-result-detail {
    color: #6b7280;
    margin-left: auto;
    text-align: right;
}
.aifi-bulk-page-warning {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 16px;
}
.aifi-bulk-page-warning .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #d97706;
    flex-shrink: 0;
}
.aifi-bulk-progress-actions {
    text-align: right;
}

/* Summary */
.aifi-bulk-summary {
    padding: 28px;
    text-align: center;
}
.aifi-bulk-summary-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 16px;
}
.aifi-bulk-summary-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 20px;
}
.aifi-bulk-stat {
    text-align: center;
}
.aifi-bulk-stat-number {
    font-size: 28px;
    font-weight: 700;
    display: block;
}
.aifi-bulk-stat-label {
    font-size: 13px;
    color: #6b7280;
}
.aifi-bulk-stat-success .aifi-bulk-stat-number {
    color: #059669;
}
.aifi-bulk-stat-skipped .aifi-bulk-stat-number {
    color: #d97706;
}
.aifi-bulk-stat-failed .aifi-bulk-stat-number {
    color: #dc2626;
}

/* Pro-locked filters */
.aifi-pro-locked {
    opacity: 0.5;
    position: relative;
}
.aifi-pro-locked select,
.aifi-pro-locked input {
    pointer-events: none;
    background: #f9fafb;
    color: #6b7280;
    -webkit-appearance: auto;
    appearance: auto;
}
.aifi-pro-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 6px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.4;
}

/* Usage Banner */
.aifi-bulk-usage-banner {
    background: #f0f4ff;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 16px;
}
.aifi-bulk-usage-info {
    font-size: 14px;
    color: #374151;
    margin-bottom: 6px;
}
.aifi-bulk-usage-info .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #667eea;
    vertical-align: text-bottom;
    margin-right: 4px;
}
.aifi-bulk-usage-cta {
    font-size: 13px;
    color: #6b7280;
}
.aifi-bulk-usage-cta a,
.aifi-bulk-usage-exhausted a {
    color: #667eea;
    font-weight: 600;
    text-decoration: none;
}
.aifi-bulk-usage-cta a:hover,
.aifi-bulk-usage-exhausted a:hover {
    text-decoration: underline;
}
.aifi-bulk-usage-exhausted {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 10px 14px;
    margin-top: 10px;
    font-size: 13px;
    color: #991b1b;
}
.aifi-bulk-usage-exhausted .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #dc2626;
    vertical-align: text-bottom;
    margin-right: 4px;
}

/* Summary usage note */
.aifi-bulk-summary-usage {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}
.aifi-bulk-summary-usage a {
    color: #667eea;
    font-weight: 600;
    text-decoration: none;
}
.aifi-bulk-summary-usage a:hover {
    text-decoration: underline;
}

/* Bulk tab panel - make it span full width when active */
.aifi-bulk-tab-panel {
    grid-column: 1 / -1;
}

/* Bulk content cards spacing */
.aifi-bulk-content .aifi-settings-card {
    margin-bottom: 20px;
}
.aifi-bulk-content .aifi-settings-card:last-child {
    margin-bottom: 0;
}

/* Loading state */
.aifi-bulk-loading {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}
.aifi-bulk-loading .spinner {
    float: none;
    margin: 0 8px 0 0;
    visibility: visible;
}

/* Empty state */
.aifi-bulk-empty {
    text-align: center;
    padding: 40px;
    color: #9ca3af;
    font-size: 14px;
}
.aifi-bulk-empty .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    display: block;
    margin: 0 auto 12px;
}

/* Responsive: stack to 2 columns on narrower screens */
@media (max-width: 960px) {
    .aifi-bulk-filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 600px) {
    .aifi-bulk-filter-grid {
        grid-template-columns: 1fr;
    }
    .aifi-bulk-filters {
        padding: 20px;
    }
}
