/* AudioRhythm - Clean minimal stylesheet */

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

body {
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

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

/* Navigation */
.navbar {
    background: #1a1a2e;
    color: white;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand a {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    transition: opacity 0.2s;
}

.nav-links a:hover {
    opacity: 0.8;
}

/* Main content */
main {
    min-height: calc(100vh - 200px);
    padding-bottom: 2rem;
}

h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #1a1a2e;
}

h2 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
    color: #1a1a2e;
}

h3 {
    font-size: 1.2rem;
    margin: 1rem 0 0.5rem;
}

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

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

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #4361ee;
}

.stat-label {
    color: #666;
    margin-top: 0.5rem;
}

/* Search */
.search-section {
    margin: 2rem 0;
}

.search-form {
    display: flex;
    gap: 0.5rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.search-input:focus {
    outline: none;
    border-color: #4361ee;
}

/* Buttons */
.btn-primary {
    background: #4361ee;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary:hover {
    background: #3651d4;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Tables */
.files-table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.files-table thead {
    background: #f8f8f8;
}

.files-table th,
.files-table td {
    padding: 0.75rem 1rem;
    text-align: left;
}

.files-table tbody tr {
    border-top: 1px solid #eee;
}

.files-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.files-table tbody tr:hover {
    background: #f0f0f0;
}

.files-table a {
    color: #4361ee;
    text-decoration: none;
}

.files-table a:hover {
    text-decoration: underline;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

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

.status-transcribed {
    background: #cce5ff;
    color: #004085;
}

.status-ingested {
    background: #fff3cd;
    color: #856404;
}

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

.status-failed {
    background: #f5c6cb;
    color: #721c24;
}

.language-tag {
    background: #e9ecef;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

/* Search results */
.results-count {
    color: #666;
    margin-bottom: 1rem;
}

.result-card {
    background: white;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.result-card h3 {
    margin-top: 0;
}

.result-card a {
    color: #4361ee;
    text-decoration: none;
}

.result-card a:hover {
    text-decoration: underline;
}

.result-meta {
    display: flex;
    gap: 1rem;
    margin: 0.5rem 0;
    font-size: 0.875rem;
    color: #666;
}

.result-snippet {
    margin-top: 1rem;
    line-height: 1.8;
}

.result-snippet em {
    background: #fff3cd;
    font-style: normal;
    padding: 0 0.25rem;
}

/* Detail page */
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.metadata-section,
.audio-player-section,
.transcript-section {
    background: white;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.metadata-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.metadata-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.metadata-item .label {
    font-size: 0.875rem;
    color: #666;
}

.metadata-item .value {
    font-weight: 500;
}

.transcript-meta {
    color: #666;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: flex;
    gap: 1.5rem;
}

.transcript-text {
    line-height: 1.8;
    font-size: 1.05rem;
    white-space: pre-wrap;
}

/* Upload page */
.upload-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 0 auto;
}

.file-input-wrapper {
    margin-bottom: 1.5rem;
}

input[type="file"] {
    display: none;
}

.file-label {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #f8f8f8;
    border: 2px dashed #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.file-label:hover {
    background: #f0f0f0;
}

.file-name {
    display: inline-block;
    margin-left: 1rem;
    color: #666;
}

.supported-formats {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.supported-formats h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.supported-formats p {
    color: #666;
}

/* HTMX spinner */
.htmx-indicator {
    display: none;
    text-align: center;
    margin-top: 1rem;
}

.htmx-indicator.htmx-request {
    display: block;
}

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

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

/* Messages */
.success-message,
.error-message,
.pending-message {
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
}

.success-message {
    background: #d4edda;
    color: #155724;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
}

.pending-message {
    background: #fff3cd;
    color: #856404;
}

.empty-state {
    text-align: center;
    color: #666;
    padding: 2rem;
}

/* Footer */
footer {
    background: #1a1a2e;
    color: white;
    padding: 1.5rem 0;
    margin-top: 3rem;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-row {
        grid-template-columns: 1fr;
    }

    .metadata-grid {
        grid-template-columns: 1fr;
    }

    .search-form {
        flex-direction: column;
    }

    .detail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}
