/* Admin S3 Manager Styles */

/* Quill Editor Styles for Author Modal */
#author-description-editor {
    height: 200px;
    background: white;
    border-radius: 0 0 8px 8px;
}

#author-description-editor .ql-editor {
    min-height: 150px;
    font-size: 0.9rem;
}

.ql-toolbar.ql-snow {
    border-radius: 8px 8px 0 0;
    background: #f8fafc;
}

.ql-container.ql-snow {
    border-radius: 0 0 8px 8px;
}

/* Hero Block Styles */
.s3-hero {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: white;
    padding: 1rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(100, 116, 139, 0.12);
}

.s3-hero h1 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.s3-hero p {
    font-size: 0.813rem;
    opacity: 0.9;
}

.s3-icon {
    font-size: 1.5rem;
    opacity: 0.95;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    margin-right: 0.75rem;
}

/* Filters Section */
.filters-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Stats Cards */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #3b82f6;
}

.stat-card p {
    color: #64748b;
    margin: 0;
}

/* Items Table */
.items-table-container {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.items-table {
    width: 100%;
    border-collapse: collapse;
}

.items-table thead {
    background: #f8fafc;
}

.items-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #334155;
    border-bottom: 2px solid #e2e8f0;
}

/* S3 Table specific column widths */
#s3-content .items-table th:nth-child(1),
#s3-content .items-table td:nth-child(1) {
    width: 90px;
    min-width: 90px;
}

#s3-content .items-table th:nth-child(2),
#s3-content .items-table td:nth-child(2) {
    width: 180px;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#s3-content .items-table th:nth-child(3),
#s3-content .items-table td:nth-child(3) {
    width: 200px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#s3-content .items-table th:nth-child(4),
#s3-content .items-table td:nth-child(4) {
    width: 120px;
    min-width: 120px;
    white-space: nowrap;
}

#s3-content .items-table th:nth-child(5),
#s3-content .items-table td:nth-child(5) {
    width: 200px;
    min-width: 150px;
}

#s3-content .items-table th:nth-child(6),
#s3-content .items-table td:nth-child(6) {
    width: 80px;
    min-width: 80px;
    text-align: center;
}

/* Compact row height for S3 table */
#s3-content .items-table td {
    padding: 0.5rem 0.75rem;
}

#s3-content .items-table th {
    padding: 0.65rem 0.75rem;
}

/* Sortable Headers */
.sortable-header {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sortable-header:hover {
    background-color: #e2e8f0;
    color: #1e40af;
}

.sortable-header.sorted-asc,
.sortable-header.sorted-desc {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.sort-indicator {
    margin-left: 0.5rem;
    display: inline-block;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.sortable-header:hover .sort-indicator {
    opacity: 1;
}

.sort-indicator i {
    font-size: 0.875rem;
}

.items-table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.items-table tbody tr:hover {
    background: #f8fafc;
}

/* Status Badges */
.badge-migrated {
    background: #10b981;
    color: white;
    padding: 0.25rem 0.65rem;
    border-radius: 12px;
    font-size: 0.813rem;
    font-weight: 500;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.badge-not-migrated {
    background: #94a3b8;
    color: white;
    padding: 0.25rem 0.65rem;
    border-radius: 12px;
    font-size: 0.813rem;
    font-weight: 500;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.badge-migrating {
    background: #f59e0b;
    color: white;
    padding: 0.25rem 0.65rem;
    border-radius: 12px;
    font-size: 0.813rem;
    font-weight: 500;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.badge-migrating i {
    animation: spin 1s linear infinite;
}

.badge-cover {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-original {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Moderation Status Badges */
.badge-pending {
    background: #f59e0b;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-approved {
    background: #10b981;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-rejected {
    background: #ef4444;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Author Type Badges */
.badge-author-original {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-author-cover {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Author Edit Button */
.btn-edit {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    margin-right: 0.5rem;
}

.btn-edit:hover {
    background: #2563eb;
}

/* Author Description Truncation */
.author-description {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

/* Author Slug Truncation */
.author-slug {
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

/* Clickable Author Slug */
.author-slug a {
    cursor: pointer;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

.author-slug a:hover {
    color: #3b82f6 !important;
    text-decoration: underline !important;
}

/* Action Buttons for Moderation */
.btn-approve {
    background: #10b981;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    margin-right: 0.5rem;
}

.btn-approve:hover {
    background: #059669;
}

.btn-reject {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-reject:hover {
    background: #dc2626;
}

/* Tabs */
.nav-tabs {
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 2rem;
}

.nav-tabs .nav-link {
    border: none;
    color: #64748b;
    font-weight: 600;
    padding: 1rem 1.5rem;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.nav-tabs .nav-link:hover {
    border-color: transparent;
    color: #3b82f6;
}

.nav-tabs .nav-link.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
    background: transparent;
}

.tab-content {
    padding-top: 1rem;
}

/* Progress Bar */
.progress-container {
    width: 200px;
    height: 24px;
    background: #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
}

.progress-text {
    font-size: 0.875rem;
    color: #64748b;
    margin-top: 0.25rem;
}

/* Action Buttons */
.btn-migrate {
    background: #10b981;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-migrate:hover {
    background: #059669;
}

.btn-migrate:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

.btn-delete {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-delete:hover {
    background: #dc2626;
}

/* Compact button variant (icon only) */
.btn-compact {
    padding: 0.4rem 0.65rem;
    font-size: 1rem;
    min-width: auto;
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-delete:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f4f6;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-state {
    text-align: center;
    padding: 3rem;
    color: #64748b;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #64748b;
}

.empty-state i {
    font-size: 4rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.pagination-info {
    color: #64748b;
    font-size: 0.875rem;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-btn {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.per-page-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.per-page-selector label {
    color: #64748b;
    font-size: 0.875rem;
    margin: 0;
}

.per-page-selector select {
    padding: 0.375rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.875rem;
    background: white;
    cursor: pointer;
}

.per-page-selector select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Compact Table Styles for Auto-Match Section */
#auto-match-content .items-table th {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
}

#auto-match-content .items-table td {
    padding: 0.4rem 0.75rem;
    font-size: 0.875rem;
}

#auto-match-content .items-table-container {
    padding: 1rem;
}

#auto-match-content .pagination-container {
    margin-top: 1rem;
    padding-top: 0.75rem;
}

#auto-match-content .pagination-btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.8125rem;
}

/* ================================
   Description Wizard Styles
   ================================ */

/* Category Cards */
.wizard-category-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 100%;
}

.wizard-category-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.wizard-category-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.wizard-category-icon i {
    font-size: 1.5rem;
    color: white;
}

.wizard-category-name {
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.5rem;
}

.wizard-category-stats {
    color: #64748b;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.wizard-category-stats .remaining {
    font-weight: 600;
    color: #f59e0b;
}

.wizard-category-progress {
    margin-top: 0.5rem;
}

.wizard-category-progress .progress {
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    margin-bottom: 0.25rem;
}

.wizard-category-progress .progress-bar {
    border-radius: 3px;
}

/* Wizard Progress Bar (top) */
.wizard-progress-bar {
    width: 150px;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.wizard-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* Character Length Bar */
.wizard-length-bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.wizard-length-fill {
    height: 100%;
    background: #f59e0b;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 3px;
}

.wizard-length-fill.good {
    background: #10b981;
}

/* Wizard Quill Editor */
#wizard-description-editor {
    height: 300px;
    background: white;
    border-radius: 0 0 8px 8px;
}

#wizard-description-editor .ql-editor {
    min-height: 250px;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Empty state icon size for wizard */
#wizard-empty-state .empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
}
