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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
}

.hidden {
    display: none !important;
}

/* Login Screen */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    margin-bottom: 1.5rem;
    text-align: center;
    color: #667eea;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

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

.btn-primary {
    width: 100%;
    padding: 0.75rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 1rem;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    padding: 0.5rem 1rem;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

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

.error-message {
    color: #dc3545;
    margin-top: 1rem;
    text-align: center;
}

/* Dashboard */
.dashboard {
    min-height: 100vh;
}

.header {
    background: white;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: #667eea;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#usernameDisplay {
    font-weight: 500;
}

/* Stats */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
}

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

.stat-card h3 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.stat-card p {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
}

.stat-card.success p {
    color: #28a745;
}

.stat-card.failed p {
    color: #dc3545;
}

.stat-card.processing p {
    color: #ffc107;
}

/* Controls */
.controls {
    padding: 1.5rem;
    background: white;
    margin: 0 1.5rem;
    border-radius: 8px;
    display: flex;
    gap: 1rem;
    align-items: center;
}

#searchInput {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
}

#statusFilter {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* Table */
.table-container {
    margin: 1.5rem;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow-x: auto;
}

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

thead {
    background: #667eea;
    color: white;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    font-weight: 600;
}

tbody tr:hover {
    background: #f8f9fa;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-block;
}

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

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

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

.transcript-preview {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    color: #667eea;
}

.transcript-preview:hover {
    text-decoration: underline;
}

.error-preview {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #dc3545;
}

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

/* Modal */
.modal {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: #666;
}

.close:hover {
    color: #333;
}

.transcript-content {
    margin-top: 1rem;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Channel Submission Section */
.channel-submit-section {
    padding: 1.5rem;
    background: white;
    margin: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.channel-submit-section h2 {
    margin-bottom: 1rem;
    color: #667eea;
}

.channel-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.channel-form input {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

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

.channel-status {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 5px;
    display: none;
}

.channel-status.success {
    background: #d4edda;
    color: #155724;
    display: block;
}

.channel-status.error {
    background: #f8d7da;
    color: #721c24;
    display: block;
}

.channel-status.info {
    background: #d1ecf1;
    color: #0c5460;
    display: block;
}

/* Tabs */
.tabs-container {
    padding: 1.5rem;
    background: white;
    margin: 0 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid #eee;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    color: #666;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #667eea;
    background: #f8f9fa;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* User Management */
.user-management-section {
    padding: 1.5rem;
    background: white;
    margin: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.user-management-section h2 {
    margin-bottom: 1.5rem;
    color: #667eea;
}

.user-form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #eee;
}

.user-form-section h3 {
    margin-bottom: 1rem;
    color: #333;
}

.user-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.user-form input {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

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

.users-list-section h3 {
    margin-bottom: 1rem;
    color: #333;
}
