* {
    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;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title {
    flex: 1;
}

.header h1 {
    font-size: 2em;
    margin-bottom: 5px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
}

.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
}

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

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9em;
}

.btn-white {
    background: white;
    color: #667eea;
}

.btn-white:hover {
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.3);
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.4);
}

.btn-danger {
    background: #dc3545;
}

.btn-success {
    background: #28a745;
}

.btn-success:hover {
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.content {
    padding: 30px;
}

.section {
    margin-bottom: 30px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px solid #e9ecef;
}

.section h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section h3 {
    color: #667eea;
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.hidden {
    display: none !important;
}

.form-group {
    margin: 15px 0;
}

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.upload-area {
    border: 3px dashed #667eea;
    border-radius: 12px;
    padding: 50px;
    text-align: center;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    background: #f8f9ff;
    border-color: #764ba2;
    transform: translateY(-2px);
}

.upload-icon {
    font-size: 4em;
    margin-bottom: 15px;
    opacity: 0.7;
}

.status {
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.status.processing {
    background: #cce5ff;
    color: #004085;
    border-left: 4px solid #0066cc;
}

.status.completed {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.status.failed {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.transcript-box,
.summary-box {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 25px;
    margin: 15px 0;
    max-height: 500px;
    overflow-y: auto;
    line-height: 1.8;
    white-space: pre-wrap;
}

.summary-box {
    line-height: 1.6;
}

.summary-box h1,
.summary-box h2,
.summary-box h3 {
    color: #667eea;
    margin-top: 20px;
    margin-bottom: 10px;
}

.summary-box ul,
.summary-box ol {
    margin-left: 25px;
    margin-bottom: 15px;
}

.summary-box p {
    margin-bottom: 15px;
}

.summary-box code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: "Courier New", monospace;
}

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

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

.login-container {
    max-width: 450px;
    margin: 80px auto;
    padding: 0;
}

.login-header {
    text-align: center;
    padding: 40px 30px;
}

.login-content {
    padding: 40px;
}

.task-list {
    list-style: none;
}

.task-item {
    padding: 20px;
    background: white;
    border-radius: 8px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.task-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.task-info {
    flex: 1;
}

.task-title {
    font-weight: 600;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.task-meta {
    color: #6c757d;
    font-size: 0.9em;
    display: flex;
    gap: 15px;
    align-items: center;
}

.task-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

.task-badge.completed {
    background: #d4edda;
    color: #155724;
}

.task-badge.processing {
    background: #cce5ff;
    color: #004085;
}

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

.task-badge.transcribing {
    background: #fff3cd;
    color: #856404;
}

.task-actions {
    display: flex;
    gap: 10px;
}

.llm-config {
    background: white;
    padding: 25px;
    border-radius: 8px;
    margin: 15px 0;
}

.llm-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.llm-grid .full-width {
    grid-column: 1 / -1;
}

.llm-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checkbox-group label {
    margin: 0;
    cursor: pointer;
    font-weight: normal;
}

.current-task-info {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border: 2px solid #667eea;
}

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

.current-task-title {
    font-weight: 600;
    font-size: 1.1em;
    color: #667eea;
}

.current-task-details {
    color: #6c757d;
    font-size: 0.9em;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.media-player-container {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.media-player {
    width: 100%;
    max-height: 400px;
    border-radius: 8px;
}

.audio-player {
    width: 100%;
}

.player-controls {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    align-items: center;
}

.player-info {
    color: #6c757d;
    font-size: 0.9em;
    margin-top: 8px;
}

/* Admin Panel Styles */
.admin-container {
    max-width: 1400px;
}

.admin-header {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.user-table-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 20px;
}

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

.user-table th,
.user-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.user-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.user-table tr:hover {
    background: #f8f9ff;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

.badge.success {
    background: #d4edda;
    color: #155724;
}

.badge.danger {
    background: #f8d7da;
    color: #721c24;
}

.create-user-form {
    background: white;
    padding: 25px;
    border-radius: 8px;
    margin-top: 20px;
}

.info-box {
    background: #e7f3ff;
    border-left: 4px solid #0066cc;
    padding: 15px;
    border-radius: 4px;
    margin: 15px 0;
    color: #004085;
}

/* Recording Indicator */
.recording-indicator {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #fff3cd;
    padding: 12px 20px;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
    font-weight: 600;
    color: #856404;
}

.recording-dot {
    width: 12px;
    height: 12px;
    background: #dc3545;
    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(1.2);
    }
}

@media (max-width: 768px) {
    .form-row,
    .llm-grid,
    .llm-actions {
        grid-template-columns: 1fr;
    }

    .header {
        flex-direction: column;
        gap: 15px;
    }

    .task-item {
        flex-direction: column;
        gap: 15px;
    }

    .task-actions,
    .llm-actions {
        width: 100%;
        flex-direction: column;
    }
}
