/*
 * TranscriptMind-specific styles
 * Base styles from: https://mcpcio.com/shared/css/mcpcio-core.css
 */

:root {
    --charcoal-primary: #1a1a1a;
    --charcoal-secondary: #2d2d2d;
    --charcoal-tertiary: #3d3d3d;
    --gold-primary: #f59e0b;
    --gold-secondary: #fbbf24;
    --gold-gradient: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    --text-primary: rgba(255, 255, 255, 0.95);
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    --border-color: rgba(255, 255, 255, 0.1);
    --success-color: #22c55e;
    --error-color: #ef4444;
    --info-color: #3b82f6;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--charcoal-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem;
}

.transcriptmind-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.hero-section {
    text-align: center;
    padding: 2rem 1rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.page-subtitle {
    color: var(--text-muted);
}

.submit-section {
    background: var(--charcoal-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
}

.submit-form {
    max-width: 600px;
    margin: 0 auto;
}

.input-wrapper {
    display: flex;
    background: var(--charcoal-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.input-wrapper:focus-within {
    border-color: var(--gold-secondary);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.url-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 1rem 1.25rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    min-height: 48px;
}

.url-input::placeholder {
    color: var(--text-muted);
}

.url-textarea {
    width: 100%;
    background: var(--charcoal-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    resize: vertical;
    min-height: 100px;
    transition: all 0.2s ease;
}

.url-textarea:focus {
    border-color: var(--gold-secondary);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.url-textarea::placeholder {
    color: var(--text-muted);
}

.submit-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    gap: 1rem;
}

.submit-row .input-hint {
    margin: 0;
    text-align: left;
}

.submit-button {
    background: var(--gold-gradient);
    border: none;
    padding: 1rem 1.5rem;
    color: var(--charcoal-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
}

.submit-button:hover:not(:disabled) {
    opacity: 0.9;
}

.submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.submit-button .hidden {
    display: none;
}

.input-hint {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
}

.submit-result {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    text-align: center;
    font-size: 0.9rem;
}

.submit-result.hidden {
    display: none;
}

.submit-result.success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--success-color);
}

.submit-result.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error-color);
}

.submit-result.info {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--info-color);
}

.stats-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.stat-card {
    background: var(--charcoal-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--gold-primary);
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.jobs-section {
    background: var(--charcoal-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.refresh-btn {
    background: var(--charcoal-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.refresh-btn:hover {
    background: var(--charcoal-primary);
    color: var(--text-primary);
}

.filter-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.filter-tab {
    background: var(--charcoal-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-tab:hover {
    background: var(--charcoal-primary);
    color: var(--text-primary);
}

.filter-tab.active {
    background: var(--gold-gradient);
    color: var(--charcoal-primary);
    border-color: transparent;
}

.jobs-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.job-card {
    display: flex;
    gap: 1rem;
    background: var(--charcoal-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.2s ease;
}

.job-card:hover {
    border-color: var(--gold-primary);
}

.job-card.status-completed {
    border-left: 3px solid var(--success-color);
}

.job-card.status-failed {
    border-left: 3px solid var(--error-color);
}

.job-card.status-processing {
    border-left: 3px solid var(--gold-primary);
}

.job-card.status-pending {
    border-left: 3px solid var(--text-muted);
}

.job-thumbnail {
    flex-shrink: 0;
    width: 120px;
    height: 68px;
    border-radius: 8px;
    overflow: hidden;
}

.job-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.job-info {
    flex: 1;
    min-width: 0;
}

.job-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.job-channel {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.job-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8rem;
}

.status-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.pending {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

.status-badge.processing {
    background: rgba(245, 158, 11, 0.2);
    color: var(--gold-primary);
}

.status-badge.completed {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success-color);
}

.status-badge.failed {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error-color);
}

.status-badge.unavailable {
    background: rgba(107, 114, 128, 0.3);
    color: #9ca3af;
}

.job-card.status-unavailable {
    border-left: 3px solid #6b7280;
    opacity: 0.7;
}

.retry-count {
    font-size: 0.7rem;
    color: var(--gold-primary);
    margin-left: 0.5rem;
}

.retry-btn {
    background: rgba(239, 68, 68, 0.2) !important;
    color: var(--error-color) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
}

.retry-btn:hover {
    background: rgba(239, 68, 68, 0.3) !important;
}

.job-date {
    color: var(--text-muted);
}

.job-error {
    font-size: 0.75rem;
    color: var(--error-color);
    margin-top: 0.5rem;
}

.job-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--gold-primary);
    margin-top: 0.5rem;
}

.progress-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--gold-primary);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.job-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    justify-content: center;
}

.action-btn {
    display: inline-block;
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 6px;
    text-align: center;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.action-btn:not(.secondary) {
    background: var(--gold-gradient);
    color: var(--charcoal-primary);
}

.action-btn:not(.secondary):hover {
    opacity: 0.9;
}

.action-btn.secondary {
    background: var(--charcoal-primary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.action-btn.secondary:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.loading-state,
.empty-state,
.error-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.empty-state a {
    color: var(--gold-primary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--gold-primary);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }

    .hero-section {
        padding: 1.5rem 0.5rem;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .stats-section {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .job-card {
        flex-direction: column;
    }

    .job-thumbnail {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .job-actions {
        flex-direction: row;
    }

    .filter-tabs {
        gap: 0.375rem;
    }

    .filter-tab {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.25rem;
    }

    .url-input {
        font-size: 16px;
        padding: 0.875rem 1rem;
    }

    .submit-button {
        padding: 0.875rem 1rem;
        min-width: 80px;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }
}

.transcript-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.transcript-modal-content {
    background: var(--charcoal-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.transcript-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.transcript-modal-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-right: 1rem;
}

.transcript-modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.transcript-modal-close:hover {
    color: var(--text-primary);
}

.transcript-modal-meta {
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--charcoal-tertiary);
}

.transcript-modal-meta p {
    margin: 0.25rem 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.transcript-modal-meta a {
    color: var(--gold-primary);
    text-decoration: none;
}

.transcript-modal-meta a:hover {
    text-decoration: underline;
}

.transcript-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.transcript-modal-body pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin: 0;
}

.transcript-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

.modal-branding {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.modal-branding a {
    color: var(--gold-primary);
    text-decoration: none;
}

.modal-branding a:hover {
    text-decoration: underline;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .transcript-modal-content {
        max-height: 95vh;
    }

    .transcript-modal-header h2 {
        font-size: 1rem;
    }

    .transcript-modal-footer {
        flex-direction: column;
    }

    .transcript-modal-footer .action-btn {
        width: 100%;
        text-align: center;
    }
}
