:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #10b981;
    --bg: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --border: rgba(255, 255, 255, 0.1);
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --glass: rgba(255, 255, 255, 0.03);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    filter: blur(80px);
}

.blob {
    position: absolute;
    width: 40vw;
    height: 40vw;
    border-radius: 50%;
    opacity: 0.15;
}

.blob-1 {
    background: var(--primary);
    top: -10%;
    left: -10%;
    animation: move 20s infinite alternate;
}

.blob-2 {
    background: #a855f7;
    bottom: -10%;
    right: -10%;
    animation: move 25s infinite alternate-reverse;
}

@keyframes move {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(10%, 10%) scale(1.1); }
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--primary);
}

header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    background: linear-gradient(to bottom right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.main-content {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

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

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
}

video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1e293b;
}

.placeholder-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.icon-circle {
    width: 64px;
    height: 64px;
    background: var(--glass);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.icon-circle svg {
    width: 32px;
    height: 32px;
}

.recording-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.recording-controls-primary {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.toggle-text {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* Switch Styles */
.switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--glass);
    transition: .3s;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-muted);
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(16px);
    background-color: var(--primary);
}

.recording-indicator {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.audio-tracks-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.audio-tracks-list::-webkit-scrollbar {
    width: 4px;
}

.audio-tracks-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.no-tracks {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
    color: var(--text-muted);
    gap: 1rem;
}

.empty-icon {
    width: 48px;
    height: 48px;
    opacity: 0.2;
}

.audio-track {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: 0.2s ease;
}

.audio-track:hover {
    background: rgba(255, 255, 255, 0.06);
}

.track-meta {
    display: flex;
    flex-direction: column;
}

.track-name {
    font-weight: 600;
    font-size: 0.95rem;
}

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

.track-actions {
    display: flex;
    gap: 0.5rem;
}

.btn {
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn svg {
    width: 20px;
    height: 20px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-record {
    background: var(--danger);
    color: white;
}

.btn-record:hover {
    background: var(--danger-hover);
}

.record-dot {
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

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

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover:not(:disabled) {
    background: var(--glass);
}

.btn-icon-only {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 10px;
    background: var(--glass);
    color: var(--text-muted);
}

.btn-icon-only:hover:not(:disabled) {
    color: var(--text);
    background: rgba(255,255,255,0.1);
}

.btn-danger { background: var(--danger); color: white; }
.btn-export {
    background: var(--success);
    color: white;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    border-radius: 16px;
}

.btn-export:hover:not(:disabled) {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
    transform: scale(1.02);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(1);
}

.footer-actions {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

/* Modal/Overlay */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.overlay-content {
    text-align: center;
    max-width: 400px;
    width: 90%;
}

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

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

.progress-container {
    height: 8px;
    background: var(--glass);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 1.5rem;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.3s ease;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: #1e293b;
    padding: 2.5rem;
    border-radius: 24px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    border: 1px solid var(--border);
}

.modal-content h3 { margin-bottom: 1rem; font-size: 1.5rem; }
.modal-content p { color: var(--text-muted); margin-bottom: 2rem; }

.modal-btn-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2rem;
    }
}