/* css/components.css — ИСПРАВЛЕНО */

/* ═══════════════════════ BUTTONS ═══════════════════════ */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: all 200ms ease;
    text-decoration: none;
    line-height: 1;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 200ms ease;
    text-decoration: none;
    line-height: 1;
    background: white;
    color: #1e293b;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #93c5fd;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: all 200ms ease;
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

/* ═══════════════════════ INPUTS ═══════════════════════ */
.input-field {
    width: 100%;
    border: 1px solid #e2e8f0;
    outline: none;
    transition: all 200ms ease;
    font-size: 0.875rem;
}

.input-field:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.code-input {
    font-size: 1.5rem;
    letter-spacing: 0.5rem;
    font-weight: 700;
}

/* ═══════════════════════ CARDS ═══════════════════════ */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: box-shadow 200ms ease;
}

.stat-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* ═══════════════════════ SPINNER ═══════════════════════ */
.spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 9999px;
    animation: spin 0.6s linear infinite;
}

.spinner-lg {
    width: 2.5rem;
    height: 2.5rem;
    border-width: 4px;
    border-color: #bfdbfe;
    border-top-color: #2563eb;
}

/* ═══════════════════════ TOAST ═══════════════════════ */
.toast {
    pointer-events: auto;
    animation: fadeIn 300ms ease-out;
    max-width: 24rem;
}

.toast-out {
    animation: fadeOut 300ms ease-in forwards;
}

/* ═══════════════════════ MODAL ═══════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    animation: fadeIn 150ms ease-out;
    padding: 1rem;
}

.modal-content {
    background: white;
    border-radius: 1.5rem;
    padding: 2rem;
    width: 100%;
    max-width: 32rem;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    animation: scaleIn 200ms ease-out;
}

/* ═══════════════════════ CONTEXT MENU ═══════════════════════ */
.ctx-menu {
    position: fixed;
    z-index: 60;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    padding: 0.25rem 0;
    min-width: 12rem;
    animation: scaleIn 100ms ease-out;
}

.ctx-menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    color: #334155;
    transition: background 150ms ease;
}

.ctx-menu-item:hover {
    background: #f8fafc;
}

.ctx-menu-item--danger {
    color: #dc2626;
}

/* ═══════════════════════ PLAYER BAR ═══════════════════════ */
.player-bar {
    animation: slideUp 300ms ease-out;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

/* ═══════════════════════ NAV ITEM ═══════════════════════ */
.nav-item {
    border: none;
    background: none;
    cursor: pointer;
}

/* ═══════════════════════ RECORDING DOT ═══════════════════════ */
.rec-dot {
    position: relative;
}

.rec-dot::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 9999px;
    background: #22c55e;
    animation: pulse-ring 1.5s ease-out infinite;
    opacity: 0;
}

.rec-dot-off::after {
    display: none;
}

/* ═══════════════════════ BLOB ═══════════════════════ */
.blob {
    position: absolute;
    border-radius: 50%;
    opacity: 0.15;
    filter: blur(80px);
    pointer-events: none;
}

/* ═══════════════════════ DRAG & DROP ═══════════════════════ */
.dragging {
    opacity: 0.5;
}

.drag-over {
    outline: 2px dashed #60a5fa;
    outline-offset: -2px;
    background: #eff6ff !important;
}

/* ═══════════════════════ ARCHIVE GRID ═══════════════════════ */
.arc-tile {
    position: relative;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 200ms ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    aspect-ratio: 1;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.arc-tile:hover {
    background: #f8fafc;
    border-color: #93c5fd;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.arc-tile__value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    transition: color 200ms ease;
}

.arc-tile:hover .arc-tile__value {
    color: #2563eb;
}

.arc-tile__label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
}

/* ═══════════════════════ SELECTION ═══════════════════════ */
.arc-selected {
    background: rgba(59, 130, 246, 0.06) !important;
}

/* ═══════════════════════ TIMELINE PLAYER ═══════════════════════ */
.timeline-bar {
    position: relative;
    transition: border-color 200ms ease;
}

.timeline-bar:hover {
    border-color: #93c5fd;
}

.timeline-segment {
    transition: all 150ms ease;
}

.timeline-segment:hover {
    filter: brightness(1.1);
    z-index: 15 !important;
}

/* Пульсация активного сегмента */
@keyframes segment-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

.timeline-segment.bg-primary-500 {
    animation: segment-pulse 2s ease-in-out infinite;
}

/* Курсор плеера */
#tl-cursor {
    transition: left 100ms linear;
}

/* Гладкая анимация плеера при появлении */
.player-bar {
    animation: slideUp 300ms ease-out;
}

/* Hover-эффект на мини-таймлайне в списке */
.timeline-bar:active {
    transform: scaleY(1.1);
}