:root {
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --record: #ef4444;
    --record-hover: #f87171;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --success: #10b981;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    background-image:
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(239, 68, 68, 0.1) 0px, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 2rem;
}

#app {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--card-bg);
    border-radius: 1rem;
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--primary), #a855f7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge {
    font-size: 0.7rem;
    background: #a855f7;
    color: #fff;
    padding: 0.2rem 0.5rem;
    border-radius: 99px;
    -webkit-text-fill-color: #fff;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    display: inline-block;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-record {
    background: var(--record);
    color: white;
}

.btn-record:hover {
    background: var(--record-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-record.recording {
    animation: pulse 1.5s infinite;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-icon:hover {
    color: var(--primary);
}

.actions-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 600px) {
    .actions-section {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card h2 {
    font-size: 1.25rem;
    color: var(--primary);
}

.card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.record-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.timer {
    font-family: monospace;
    font-size: 1.25rem;
    color: var(--success);
}

.progress-bar-container {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 99px;
    height: 8px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary);
    width: 0%;
    transition: width 0.3s ease;
}

.status-text {
    font-size: 0.85rem;
    color: var(--primary) !important;
}

.history-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
    position: relative;
}

.history-section h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

.history-section>.btn-icon {
    position: absolute;
    top: 2rem;
    right: 2rem;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    transition: background 0.2s ease;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.history-info strong {
    display: block;
    margin-bottom: 0.25rem;
}

.history-info span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-Uploading {
    background: #3b82f6;
    color: white;
}

.status-Processing {
    background: #f59e0b;
    color: white;
}

.status-Transcribing {
    background: #8b5cf6;
    color: white;
}

.status-Completed {
    background: #10b981;
    color: white;
}

.status-Failed {
    background: #ef4444;
    color: white;
}

.download-btn {
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
}

.download-btn:hover {
    background: var(--primary-hover);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}