:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --success: #10b981;
    --danger: #ef4444;
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body.dark-mode {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    background: radial-gradient(circle at top right, #1e1b4b, #0f172a);
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.logo span {
    color: var(--primary);
}

.user-badge {
    background: var(--card-bg);
    padding: 0.5rem 1rem;
    border-radius: 99px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--glass-border);
}

main {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
}

.recorder-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.video-container {
    position: relative;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 1.5rem;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

#inputVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
    opacity: 0.3;
}

#outputCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: scaleX(-1);
}

.glass {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
}

.record-indicator {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(0, 0, 0, 0.6);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    color: var(--danger);
    font-weight: 600;
    display: none;
    align-items: center;
    gap: 0.5rem;
}

.record-indicator .dot {
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.controls-panel {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.glass-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    color: white;
    outline: none;
    transition: all 0.2s;
}

.glass-input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.recording-progress {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: var(--primary);
    transition: width 0.1s linear;
}

#timerText {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: right;
}

.stat-card {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.stat-card .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card .value {
    font-size: 1.25rem;
    font-weight: 700;
}

.actions {
    display: flex;
    gap: 1rem;
}

button {
    flex: 1;
    padding: 1rem;
    border-radius: 0.75rem;
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.primary-btn {
    background: var(--primary);
    color: white;
}

.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.stop-btn {
    background: var(--danger);
    color: white;
}

.stop-btn:hover {
    background: #dc2626;
}

.success-btn {
    background: var(--success);
    color: white;
}

.success-btn:hover {
    background: #059669;
}

.hidden {
    display: none !important;
}

.info-aside {
    padding: 1.5rem;
    height: fit-content;
}

.info-aside h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.info-aside p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.info-aside hr {
    margin: 1.5rem 0;
    border: none;
    border-top: 1px solid var(--glass-border);
}

.info-aside ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-aside li::before {
    content: "→";
    margin-right: 0.5rem;
    color: var(--primary);
}

footer {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.8);
}

.modal-content {
    width: 400px;
    padding: 2.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}