/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stats {
    display: flex;
    gap: 32px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-top: 4px;
}

/* Loading and Error States */
.loading, .error {
    text-align: center;
    padding: 60px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

.error h3 {
    color: #e74c3c;
    margin-bottom: 12px;
}

.retry-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 16px;
    transition: all 0.2s;
}

.retry-btn:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

/* Dashboard */
.dashboard {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.filters {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
}

.filters input, .filters select, .filters button {
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.filters input:focus, .filters select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filters button {
    background: #667eea;
    color: white;
    border: 2px solid #667eea;
    cursor: pointer;
    font-weight: 600;
}

.filters button:hover {
    background: #5a6fd8;
    border-color: #5a6fd8;
}

/* Videos Grid */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.video-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.video-thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #f8f9fa;
}

.video-info {
    padding: 16px;
}

.video-id {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 8px;
    font-family: monospace;
}

.video-owner {
    font-size: 0.85rem;
    color: #764ba2;
    margin-bottom: 8px;
    font-weight: 600;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.video-duration {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.video-audio {
    font-size: 0.8rem;
    color: #666;
}

.video-location {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.video-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.tag {
    background: #f1f3f4;
    color: #555;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.comments-preview {
    border-top: 1px solid #e1e5e9;
    padding-top: 12px;
}

.comments-count {
    font-size: 0.9rem;
    color: #667eea;
    font-weight: 600;
    margin-bottom: 8px;
}

.comment-preview {
    background: #f8f9fa;
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.comment-author {
    font-weight: 600;
    color: #333;
}

.comment-text {
    color: #666;
    margin-top: 2px;
}

/* List View */
.videos-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.video-card.list-view {
    display: flex;
    height: 120px;
}

.video-card.list-view .video-thumbnail {
    width: 200px;
    height: 120px;
    flex-shrink: 0;
}

.video-card.list-view .video-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e1e5e9;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.close-btn:hover {
    background: #f1f3f4;
    color: #333;
}

.modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.video-section {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.video-section img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.video-info p {
    margin-bottom: 8px;
    line-height: 1.5;
}

.comments-section h4 {
    margin-bottom: 16px;
    color: #333;
}

.comments-list {
    max-height: 300px;
    overflow-y: auto;
}

.comment-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.comment-author-modal {
    font-weight: 600;
    color: #333;
}

.comment-time {
    font-size: 0.8rem;
    color: #666;
}

.comment-source {
    font-size: 0.75rem;
    color: #667eea;
    font-weight: 500;
}

.comment-visibility {
    font-size: 0.75rem;
    color: #888;
    margin-left: 8px;
}

.toggle-visibility-btn {
    background: #f1f3f4;
    color: #333;
    border: 1px solid #ddd;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    margin-left: 8px;
    transition: all 0.2s;
}

.toggle-visibility-btn:hover {
    background: #e8eaed;
    border-color: #bbb;
}

.comment-hidden {
    opacity: 0.6;
    background: #f9f9f9 !important;
    border-left: 3px solid #ff6b6b;
}

.comment-hidden .comment-text {
    text-decoration: line-through;
    color: #999;
}

.video-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    display: flex;
    gap: 4px;
}

.delete-video-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e74c3c;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}

.delete-video-btn:hover {
    background: #e74c3c;
    color: white;
    transform: scale(1.1);
}

.generate-ideas-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #667eea;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}

.generate-ideas-btn:hover {
    background: #667eea;
    color: white;
    transform: scale(1.1);
}

.video-card {
    position: relative;
}

.video-card:hover .video-actions {
    opacity: 1;
}

/* Upload Button */
.upload-btn {
    background: #28a745 !important;
    border-color: #28a745 !important;
}

.upload-btn:hover {
    background: #218838 !important;
    border-color: #218838 !important;
}

/* Upload Modal */
.upload-section {
    margin-bottom: 20px;
}

.file-upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: #667eea;
    background: #f8f9fa;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.upload-icon {
    font-size: 3rem;
    color: #667eea;
}

.upload-text p {
    margin: 4px 0;
    color: #555;
}

.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e1e5e9;
}

.file-name {
    font-weight: 600;
    color: #333;
}

.file-size {
    font-size: 0.9rem;
    color: #666;
}

.clear-file-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.clear-file-btn:hover {
    background: #c82333;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.location-inputs {
    display: flex;
    gap: 12px;
}

.location-inputs input {
    flex: 1;
}

/* Video Preview Styles */
.video-preview {
    margin-top: 12px;
}

.video-preview video {
    width: 100%;
    max-width: 400px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #000;
}

.video-preview .video-info {
    margin-top: 8px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 13px;
    color: #666;
}

.upload-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.cancel-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.cancel-btn:hover {
    background: #5a6268;
}

.upload-submit-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    min-width: 120px;
}

.upload-submit-btn:hover {
    background: #218838;
}

.upload-submit-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.btn-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .videos-grid {
        grid-template-columns: 1fr;
    }
    
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .video-section {
        flex-direction: column;
    }
    
    .video-section img {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
}

/* Reports Section Styles */
.reports-section {
    margin-bottom: 24px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.reports-section h4 {
    color: #ff6b6b;
    margin-bottom: 16px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.reports-summary {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.reports-summary.empty {
    background: #f0fff4;
    border-color: #c6f6d5;
    color: #38a169;
    text-align: center;
    font-style: italic;
}

.reports-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.report-stat {
    background: white;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    font-size: 0.9rem;
}

.report-stat-number {
    font-weight: bold;
    color: #e53e3e;
}

.primary-reason {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 600;
}

.reasons-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.reason-chip {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid #bbdefb;
}

.reason-count-badge {
    background: #1976d2;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    min-width: 18px;
}

.reports-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
}

.individual-report {
    padding: 12px 16px;
    border-bottom: 1px solid #f7fafc;
    transition: background-color 0.2s ease;
}

.individual-report:hover {
    background-color: #f7fafc;
}

.individual-report:last-child {
    border-bottom: none;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.reporter-id {
    font-family: 'Courier New', monospace;
    background: #f7fafc;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #4a5568;
    border: 1px solid #e2e8f0;
}

.report-time {
    font-size: 0.75rem;
    color: #a0aec0;
}

.report-reason {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 4px;
}

.report-status {
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.report-status.pending {
    background: #fef5e7;
    color: #d69e2e;
    border: 1px solid #f6e05e;
}

.report-status.reviewed {
    background: #e6fffa;
    color: #319795;
    border: 1px solid #81e6d9;
}

.report-status.resolved {
    background: #f0fff4;
    color: #38a169;
    border: 1px solid #9ae6b4;
}

.report-status.dismissed {
    background: #f7fafc;
    color: #718096;
    border: 1px solid #e2e8f0;
}

/* Add report indicator to video cards */
.video-card.has-reports {
    border-left: 4px solid #ff6b6b;
}

/* Comment Reports Section in Modal */
.comment-reports-section {
    margin-bottom: 24px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.comment-reports-section h4 {
    color: #8b5cf6;
    margin-bottom: 16px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-reports-summary {
    background: #faf5ff;
    border: 1px solid #d8b4fe;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.comment-reports-summary.empty {
    background: #f0fff4;
    border-color: #c6f6d5;
    color: #38a169;
    text-align: center;
    font-style: italic;
}

.comment-reports-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
}

.individual-comment-report {
    padding: 12px 16px;
    border-bottom: 1px solid #f7fafc;
    transition: background-color 0.2s ease;
}

.individual-comment-report:hover {
    background-color: #f7fafc;
}

.individual-comment-report:last-child {
    border-bottom: none;
}

.comment-report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.comment-report-reason {
    background: #8b5cf6;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.comment-text-preview {
    background: #f8f9fa;
    border-left: 3px solid #8b5cf6;
    padding: 8px 12px;
    margin: 8px 0;
    border-radius: 4px;
    font-style: italic;
    color: #4a5568;
}

.comment-report-status {
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.comment-report-status.pending {
    background: #fef5e7;
    color: #d69e2e;
    border: 1px solid #f6e05e;
}

.video-card.has-reports::after {
    content: '🚨';
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 1.2rem;
    z-index: 2;
}

.reports-indicator {
    position: absolute;
    top: 8px;
    right: 32px;
    background: #ff6b6b;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    z-index: 3;
}

/* Reported Comments Section */
.reported-comments-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 24px;
    margin-top: 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.reported-comments-section h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: #d63384;
}

.loading-comments {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
    color: #666;
}

.loading-comments .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #d63384;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

.reported-comment-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease;
}

.reported-comment-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.comment-author {
    font-weight: 600;
    color: #333;
}

.comment-date {
    color: #666;
    font-size: 0.9rem;
}

.report-count {
    background: #d63384;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.comment-content {
    margin: 16px 0;
}

.comment-text {
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 4px solid #d63384;
    font-style: italic;
    line-height: 1.5;
}

.reports-info {
    margin: 16px 0;
    padding: 12px;
    background: #fff5f5;
    border-radius: 8px;
}

.primary-reason {
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.reasons-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.reason-tag {
    background: #ffc107;
    color: #000;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.comment-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.action-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.hide-btn {
    background: #dc3545;
    color: white;
}

.hide-btn:hover {
    background: #c82333;
}

.dismiss-btn {
    background: #28a745;
    color: white;
}

.dismiss-btn:hover {
    background: #218838;
}

.no-reports {
    text-align: center;
    padding: 40px;
    color: #28a745;
    font-size: 1.1rem;
}

.error-message {
    text-align: center;
    padding: 40px;
    color: #dc3545;
}

.retry-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 12px;
    font-weight: 600;
}

.retry-btn:hover {
    background: #0056b3;
}

/* ============ IDEAS MODAL STYLES ============ */

.ideas-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.ideas-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.ideas-modal-content {
    max-width: 1200px;
    width: 95%;
}

.ideas-modal-content textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    transition: border-color 0.3s;
}

.ideas-modal-content textarea:focus {
    outline: none;
    border-color: #667eea;
}

.help-text {
    font-size: 0.85rem;
    color: #666;
    margin-top: 8px;
    font-style: italic;
}

.ideas-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    flex-wrap: wrap; /* Allow buttons to wrap if needed */
}

.generate-ideas-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: transform 0.2s;
    position: relative;
    white-space: nowrap; /* Prevent text wrapping */
}

.generate-ideas-btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

.generate-ideas-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.generated-ideas-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid #e0e0e0;
}

.generated-ideas-section h4 {
    margin-bottom: 16px;
    color: #333;
    font-size: 1.1rem;
}

.generated-ideas-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.generated-idea-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 8px;
    border-left: 4px solid #667eea;
    transition: transform 0.2s, box-shadow 0.2s;
}

.generated-idea-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.idea-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #667eea;
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
}

.idea-text {
    flex: 1;
    line-height: 1.6;
    color: #333;
}

.copy-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.copy-btn:hover {
    background: #218838;
}

.history-btn {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.history-btn:hover {
    background: #138496;
}

.prompt-history-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid #e0e0e0;
}

.history-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.history-header-bar h4 {
    margin: 0;
    color: #333;
    font-size: 1.1rem;
}

.hide-history-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.hide-history-btn:hover {
    background: #5a6268;
}

.prompt-history-list {
    max-height: 500px;
    overflow-y: auto;
}

.history-item {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    transition: box-shadow 0.2s;
}

.history-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #dee2e6;
}

.history-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.history-date {
    font-size: 0.9rem;
    color: #666;
}

.history-count {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.delete-history-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.delete-history-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.delete-history-btn:active {
    transform: translateY(0);
}

.history-prompt {
    background: white;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    border-left: 4px solid #667eea;
}

.history-prompt strong {
    color: #667eea;
}

.history-ideas {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-idea-item {
    display: flex;
    gap: 8px;
    padding: 10px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.history-idea-number {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #667eea;
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.8rem;
}

.history-idea-text {
    flex: 1;
    line-height: 1.5;
    color: #333;
}

/* History Frames Styles */
.history-frames {
    margin-top: 12px;
    margin-bottom: 16px;
}

.history-frames strong {
    display: block;
    margin-bottom: 10px;
    color: #495057;
    font-size: 0.95rem;
}

.history-frames-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.history-frame-item {
    position: relative;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    transition: transform 0.2s, border-color 0.2s;
}

.history-frame-item:hover {
    transform: translateY(-2px);
    border-color: #667eea;
}

.history-frame-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    display: block;
}

.history-frame-item .frame-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 4px;
    font-size: 10px;
    text-align: center;
    font-weight: 600;
}
/* Lenses Button */
.lenses-btn {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%) !important;
    color: #1a1a2e !important;
    border: none !important;
    font-weight: 700 !important;
}

.lenses-btn:hover {
    background: linear-gradient(135deg, #FFA500 0%, #FF8C00 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

/* Model Badges */
.model-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 8px;
}

.model-badge.model-grok {
    background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
    color: white;
}

.model-badge.model-mini {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.model-badge.model-gpt4 {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.history-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.history-video-id {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #4a5568;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    font-family: 'Monaco', 'Menlo', monospace;
}

.history-video-id.no-video {
    background: #f0f0f0;
    color: #888;
}

/* Model Response Styling */
.model-response {
    margin-top: 15px;
    padding: 15px;
    border-radius: 8px;
    background: #f8f9fa;
}

.model-response h5 {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
}

.response-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.processing-time,
.ideas-count,
.history-type {
    padding: 4px 10px;
    background: white;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
}

.response-content pre,
.history-response pre {
    background: white;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 12px;
    line-height: 1.5;
    max-height: 400px;
    overflow-y: auto;
}

.response-ideas {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.generated-idea {
    display: flex;
    gap: 10px;
    padding: 12px;
    background: white;
    border-radius: 6px;
    border-left: 3px solid #4facfe;
}

.idea-number {
    font-weight: 700;
    color: #4facfe;
    min-width: 30px;
}

.idea-text {
    flex: 1;
    line-height: 1.5;
}

/* Grok Response */
.grok-response {
    border-left: 4px solid #00d2ff;
}

/* Mini Response */
.mini-response {
    border-left: 4px solid #f093fb;
}

/* GPT-4 Response */
.gpt4-response {
    border-left: 4px solid #4facfe;
}

/* Model Help Text Styling */
.model-help-text {
    margin-top: 12px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.model-help-content {
    font-size: 13px;
    line-height: 1.6;
}

.model-help-content strong {
    color: #333;
    display: block;
    margin-bottom: 10px;
}

.model-help-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.model-help-content li {
    margin: 8px 0;
    color: #555;
}

.model-help-content code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #d63384;
}

.model-help-content .note {
    margin-top: 12px;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    font-size: 12px;
    border-left: 3px solid #667eea;
}

.load-default-btn {
    margin-top: 12px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.load-default-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.grok-help {
    border-left-color: #00d2ff;
}

.grok-help .note {
    border-left-color: #00d2ff;
}

.mini-help {
    border-left-color: #f093fb;
}

.mini-help .note {
    border-left-color: #f093fb;
}

.gpt4-help {
    border-left-color: #4facfe;
}

.gpt4-help .note {
    border-left-color: #4facfe;
}

/* ============ IDEAS PAGE STYLES ============ */

.ideas-page-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.ideas-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
}

.ideas-section h2 {
    margin-bottom: 16px;
    color: #333;
    font-size: 1.5rem;
}

/* ============ 3-STEP PIPELINE CARDS ============ */

.pipeline-steps {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 24px;
}

.step-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid #e1e5e9;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: white;
}

.step-1 .step-number { background: linear-gradient(135deg, #00d2ff, #00a3cc); }
.step-2 .step-number { background: linear-gradient(135deg, #f093fb, #f5576c); }
.step-3 .step-number { background: linear-gradient(135deg, #667eea, #764ba2); }

.step-1 .step-header { border-left: 4px solid #00d2ff; }
.step-2 .step-header { border-left: 4px solid #f093fb; }
.step-3 .step-header { border-left: 4px solid #667eea; }

.step-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.step-title h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #333;
}

.step-content {
    padding: 24px;
    width: 100%;
    box-sizing: border-box;
}

/* Video Input Section */
.video-input-section {
    margin-bottom: 20px;
}

.video-input-section > label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: #333;
}

.video-selector-compact {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.selected-video-info-step1 {
    flex: 1;
    min-width: 200px;
}

.selected-video-compact {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f0f7ff;
    border-radius: 8px;
    border: 2px solid #667eea;
}

.selected-thumb-small {
    width: 50px;
    height: 35px;
    object-fit: cover;
    border-radius: 4px;
}

.selected-video-id {
    font-family: monospace;
    font-size: 13px;
    color: #333;
}

.clear-btn-small {
    background: #dc3545;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.select-video-btn-small {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
}

.or-divider {
    color: #999;
    font-size: 13px;
}

.video-input-section input[type="file"] {
    font-size: 13px;
}

/* Prompt Section */

.prompt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.prompt-header label {
    font-weight: 600;
    color: #333;
}

.reset-btn-small {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #ddd;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.reset-btn-small:hover {
    background: #e9ecef;
    color: #333;
}

.step-card textarea {
    width: 100%;
    min-height: 250px;
    padding: 16px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
    background: #fafbfc;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.prompt-section {
    width: 100%;
    margin-bottom: 20px;
}

.step-card textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
    background: white;
}

.step-hint {
    margin-top: 8px;
    font-size: 13px;
    color: #666;
    font-style: italic;
}

/* Ideas Count Row */
.ideas-count-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.ideas-count-row label {
    font-weight: 600;
    color: #333;
}

.ideas-count-row input {
    width: 80px;
    padding: 8px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
}

/* Step Actions */
.step-actions {
    margin-bottom: 20px;
}

.run-step-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.run-step-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.run-step-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.step-1 .run-step-btn { background: linear-gradient(135deg, #00d2ff, #00a3cc); }
.step-2 .run-step-btn { background: linear-gradient(135deg, #f093fb, #f5576c); }
.step-3 .run-step-btn { background: linear-gradient(135deg, #667eea, #764ba2); }

/* Step Output */
.step-output {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #e1e5e9;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.output-header label {
    font-weight: 600;
    color: #333;
}

.copy-btn-small {
    background: #28a745;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

.copy-btn-small:hover {
    background: #218838;
}

.step-output pre {
    background: white;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 12px;
    line-height: 1.5;
    margin: 0;
    max-height: 400px;
    overflow-y: auto;
}

/* Ideas Output (Step 3) */
.ideas-output {
    background: white;
    border-radius: 8px;
    padding: 16px;
}

.idea-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.idea-item:last-child {
    border-bottom: none;
}

.idea-number {
    font-weight: 700;
    color: #667eea;
    min-width: 24px;
}

.idea-text {
    flex: 1;
    line-height: 1.5;
}

.section-description {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

/* Video Selection */
.video-selector {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.selected-video-info {
    flex: 1;
    min-width: 200px;
}

.no-video-selected {
    color: #666;
    font-style: italic;
}

.selected-video-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #667eea;
}

.selected-video-thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.selected-video-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.selected-video-location {
    font-size: 0.85rem;
    color: #666;
}

.clear-selection-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    margin-left: auto;
}

.clear-selection-btn:hover {
    background: #c82333;
}

.select-video-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.select-video-btn:hover {
    background: #5a6fd8;
}

/* Video Grid Container */
.video-grid-container {
    margin-top: 20px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e1e5e9;
}

.video-grid-header {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    align-items: center;
}

.video-search-input {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
}

.video-search-input:focus {
    outline: none;
    border-color: #667eea;
}

.close-grid-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.close-grid-btn:hover {
    background: #5a6268;
}

.video-grid-for-page {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.video-grid-item-page {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.video-grid-item-page:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.video-grid-item-page img {
    width: 100%;
    height: 100px;
    object-fit: cover;
}

.video-grid-item-info {
    padding: 8px;
}

.video-grid-item-id {
    font-size: 0.75rem;
    color: #666;
    font-family: monospace;
}

.video-grid-item-location {
    font-size: 0.7rem;
    color: #888;
    margin-top: 4px;
}

/* Response Header Bar */
.response-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.response-header-bar h2 {
    margin-bottom: 0;
}

/* History Section Page */
.history-section-page {
    margin-top: 0;
}

.history-section-page h2 {
    margin-bottom: 0;
}

/* Back Button */
.back-btn {
    background: #6c757d !important;
    border-color: #6c757d !important;
}

.back-btn:hover {
    background: #5a6268 !important;
    border-color: #5a6268 !important;
}

.header-nav {
    display: flex;
    gap: 12px;
}

.nav-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

/* Ideas Button in Dashboard */
.ideas-page-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none !important;
}

.ideas-page-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ============ PINNED SPARQS STYLES ============ */

.pinned-sparqs-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%) !important;
    color: white !important;
    border: none !important;
    font-weight: 700 !important;
}

.pinned-sparqs-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.pinned-sparqs-modal-content {
    max-width: 800px;
    width: 95%;
}

.modal-description {
    color: #666;
    margin-bottom: 24px;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Add Pinned Sparq Form */
.pinned-form-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.pinned-text-group {
    flex: 1;
    min-width: 300px;
}

.pinned-text-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    transition: border-color 0.3s;
}

.pinned-text-group textarea:focus {
    outline: none;
    border-color: #ff6b6b;
}

.pinned-rank-group {
    width: 100px;
}

.pinned-rank-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    text-align: center;
}

.pinned-rank-group input:focus {
    outline: none;
    border-color: #ff6b6b;
}

.add-pinned-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s;
    align-self: flex-end;
    margin-bottom: 4px;
}

.add-pinned-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

/* Pinned List Section */
.pinned-sparqs-list-section {
    border-top: 2px solid #e0e0e0;
    padding-top: 24px;
}

.pinned-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.pinned-list-header h4 {
    margin: 0;
    color: #333;
    font-size: 1.1rem;
}

.refresh-btn-small {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.refresh-btn-small:hover {
    background: #138496;
}

/* Pinned Sparq Items */
.pinned-sparqs-list {
    max-height: 400px;
    overflow-y: auto;
}

.pinned-sparq-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    border-left: 4px solid #ff6b6b;
    transition: all 0.2s;
    align-items: flex-start;
}

.pinned-sparq-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.pinned-sparq-item.inactive {
    opacity: 0.6;
    border-left-color: #adb5bd;
}

.pinned-sparq-rank {
    flex-shrink: 0;
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
}

.pinned-sparq-item.inactive .rank-badge {
    background: linear-gradient(135deg, #adb5bd 0%, #6c757d 100%);
}

.pinned-sparq-content {
    flex: 1;
    min-width: 0;
}

.pinned-sparq-text {
    margin: 0 0 8px 0;
    line-height: 1.5;
    color: #333;
    word-wrap: break-word;
}

.pinned-sparq-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.source-badge {
    background: #e9ecef;
    color: #495057;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

.pinned-sparq-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.pinned-sparq-actions button {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-btn {
    background: #e9ecef;
}

.toggle-btn:hover {
    background: #dee2e6;
}

.edit-btn {
    background: #fff3cd;
}

.edit-btn:hover {
    background: #ffc107;
}

.delete-btn {
    background: #f8d7da;
}

.delete-btn:hover {
    background: #dc3545;
    color: white;
}

/* Empty/Loading/Error States */
.loading-text,
.empty-text,
.error-text {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

.error-text {
    color: #dc3545;
}

/* ============================================================================
   SPARQS PREVIEW STYLES (updated from comments)
   ============================================================================ */

.sparqs-preview {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.sparqs-count {
    font-weight: 600;
    font-size: 0.9rem;
    color: #667eea;
    margin-bottom: 8px;
}

.sparq-preview {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.sparq-source {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #667eea;
    margin-bottom: 2px;
}

.sparq-text {
    color: #555;
    line-height: 1.4;
}

/* ============================================================================
   SIGNIFICANCE LEDGER BUTTON
   ============================================================================ */

.significance-ledger-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
}

.significance-ledger-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ============================================================================
   SPARQS IN MODAL (updated from comments)
   ============================================================================ */

.sparq-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    border-left: 4px solid #667eea;
}

.sparq-item.sparq-hidden {
    opacity: 0.5;
    border-left-color: #ccc;
}

.sparq-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

.sparq-rank {
    font-weight: 700;
    font-size: 1.2rem;
    color: #667eea;
}

.sparq-source {
    background: #e9ecef;
    color: #495057;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.sparq-source.gemini-direct {
    background: #d4edda;
    color: #155724;
}

.sparq-source.collision {
    background: #fff3cd;
    color: #856404;
}

.sparq-source.cognitive {
    background: #cce5ff;
    color: #004085;
}

.sparq-time {
    font-size: 0.8rem;
    color: #888;
}

.sparq-visibility {
    font-size: 0.75rem;
    color: #666;
}

.sparq-text-full {
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
    margin-bottom: 8px;
}

.sparq-collision {
    font-size: 0.85rem;
    color: #856404;
    background: #fff3cd;
    padding: 6px 10px;
    border-radius: 8px;
    margin-top: 8px;
}

/* ============================================================================
   SIGNIFICANCE LEDGER MODAL
   ============================================================================ */

.significance-ledger-modal {
    max-width: 800px;
    width: 95%;
    max-height: 90vh;
}

.ledger-content {
    max-height: 70vh;
    overflow-y: auto;
    padding: 16px;
}

.ledger-sparqs {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ledger-sparq-item {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #667eea;
}

.ledger-sparq-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.ledger-rank {
    font-weight: 700;
    font-size: 1.3rem;
    color: #667eea;
}

.ledger-source {
    background: #e9ecef;
    color: #495057;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.ledger-source.gemini-direct {
    background: #d4edda;
    color: #155724;
}

.ledger-source.collision {
    background: #fff3cd;
    color: #856404;
}

.ledger-source.cognitive {
    background: #cce5ff;
    color: #004085;
}

.ledger-badge {
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.ledger-badge.has-ledger {
    background: #d4edda;
    color: #155724;
}

.ledger-badge.no-ledger {
    background: #f8d7da;
    color: #721c24;
}

.ledger-sparq-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #333;
    font-style: italic;
    margin-bottom: 16px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.ledger-details {
    margin-top: 16px;
}

.ledger-details h5 {
    color: #667eea;
    font-size: 1rem;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eee;
}

.ledger-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
}

.ledger-field {
    margin-bottom: 8px;
    line-height: 1.5;
}

.ledger-field:last-child {
    margin-bottom: 0;
}

.ledger-field strong {
    color: #495057;
}

.verdict {
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
}

.verdict.PUBLISH {
    background: #d4edda;
    color: #155724;
}

.verdict.SILENCE {
    background: #f8d7da;
    color: #721c24;
}

.verdict.HOLD {
    background: #fff3cd;
    color: #856404;
}

.ledger-section.scores {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.ledger-score {
    background: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.no-data {
    color: #888;
    font-style: italic;
    padding: 8px 0;
}

.no-ledger-data {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.no-ledger-data .hint {
    font-size: 0.85rem;
    color: #888;
    margin-top: 8px;
}

.empty-ledger {
    text-align: center;
    padding: 40px 20px;
}

.empty-ledger p {
    margin-bottom: 12px;
    color: #666;
}

/* ============================================================================
   SPARQS SECTION IN MODAL (renamed from comments-section)
   ============================================================================ */

.sparqs-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.sparqs-section h4 {
    color: #667eea;
    margin-bottom: 16px;
    font-size: 1.1rem;
}

.sparqs-list {
    max-height: 400px;
    overflow-y: auto;
}

/* ============================================================================
   REGENERATE SPARQS BUTTON
   ============================================================================ */

.regenerate-sparqs-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%) !important;
    color: white !important;
}

.regenerate-sparqs-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(238, 90, 36, 0.4);
}
