/* animation-tab.css - Animation Tab (matching existing sidebar style) */

/* =========================================
   EXPAND PANEL WHEN ANIMATION TAB IS ACTIVE
   ========================================= */
#animationTools {
    gap: 8px;
    padding: 10px 0;
    align-items: center;
    min-width: 52px;
}

/* Keep same width as all other tabs (52px from navigation.css) */

/* =========================================
   NAVIGATION ARROWS - matches tool-btn style
   ========================================= */
.anim-nav-arrows {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    width: 100%;
}

.anim-nav-btn {
    width: 38px;
    height: 30px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--tr-fast);
}

.anim-nav-btn:hover {
    background: var(--bg-item);
    color: var(--text-main);
}

.anim-nav-btn:active {
    transform: scale(0.92);
}

.anim-nav-btn.disabled {
    opacity: 0.25;
    pointer-events: none;
}

/* Step counter - subtle */
.anim-step-counter {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-item);
    padding: 2px 8px;
    border-radius: 10px;
    text-align: center;
    white-space: nowrap;
    line-height: 1.4;
}

/* =========================================
   PLAY / RESET - STACKED VERTICALLY
   ========================================= */
.anim-controls-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    justify-content: center;
}

.anim-play-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bg-item);
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.anim-play-btn:hover {
    background: var(--primary);
    color: var(--text-on-accent);
    transform: scale(1.08);
    box-shadow: 0 4px 15px rgba(59, 131, 246, 0.35);
}

.anim-play-btn:active {
    transform: scale(0.93);
}

.anim-play-btn.playing {
    background: #ef4444;
    color: white;
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.3);
    animation: pulse-play 1.5s infinite;
}

@keyframes pulse-play {
    0%, 100% { box-shadow: 0 3px 10px rgba(239, 68, 68, 0.3); }
    50% { box-shadow: 0 3px 16px rgba(239, 68, 68, 0.5); }
}

.anim-reset-btn {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.65rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--tr-fast);
}

.anim-reset-btn:hover {
    background: var(--bg-item);
    color: var(--text-main);
}

/* =========================================
   ADD ANIMATION BUTTON
   ========================================= */
.anim-add-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px dashed var(--border-glass);
    color: var(--text-muted);
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.anim-add-btn:hover {
    background: var(--bg-item);
    color: var(--text-main);
    border-color: var(--text-muted);
    transform: scale(1.05);
}

.anim-add-btn:active {
    transform: scale(0.92);
}

/* =========================================
   STEPS LIST
   ========================================= */
.anim-steps-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 4px;
    scrollbar-width: thin;
}

.anim-steps-list::-webkit-scrollbar { width: 2px; }
.anim-steps-list::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 2px; }

/* Step item - matches tool-btn style */
.anim-step-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 2px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--tr-fast);
    position: relative;
    min-height: 32px;
    user-select: none;
}

.anim-step-item:hover {
    background: var(--bg-item);
}

.anim-step-item.active {
    background: var(--primary);
    box-shadow: 0 4px 15px rgba(59, 131, 246, 0.35);
}

/* Step number */
.anim-step-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--bg-item);
    color: var(--text-muted);
    font-size: 0.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.anim-step-item.active .anim-step-num {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-on-accent);
}

/* Hide text and drag handle in compact mode */
.anim-step-info { display: none; }
.anim-step-drag { display: none; }

/* Delete: red circle on hover */
.anim-step-delete {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ef4444;
    border: none;
    color: white;
    font-size: 0.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.15s;
    z-index: 2;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.anim-step-item:hover .anim-step-delete { opacity: 1; }
.anim-step-delete:hover { transform: scale(1.2); }

/* Drag states */
.anim-step-item.drag-over {
    border-color: var(--primary);
    background: rgba(59, 131, 246, 0.1);
}

.anim-step-item.dragging { opacity: 0.3; }

/* =========================================
   EMPTY STATE  
   ========================================= */
.anim-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 2px;
    text-align: center;
}

.anim-empty-state i {
    font-size: 0.9rem;
    color: var(--text-muted);
    opacity: 0.3;
    margin-bottom: 4px;
}

.anim-empty-state p {
    font-size: 0.5rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.3;
    opacity: 0.5;
}

/* =========================================
   ANIMATION PICKER POPUP (floating)
   ========================================= */
.anim-picker-popup {
    position: fixed;
    z-index: 10000;
    background: var(--bg-surface-solid);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    padding: 10px;
    width: 240px;
    max-height: 360px;
    overflow-y: auto;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
    display: none;
    animation: animPickerIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.anim-picker-popup.show { display: block; }

@keyframes animPickerIn {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.anim-picker-popup::-webkit-scrollbar { width: 3px; }
.anim-picker-popup::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }

.anim-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-glass);
}

.anim-picker-header h4 {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 5px;
}

.anim-picker-header h4 i { color: var(--primary); font-size: 0.75rem; }

.anim-picker-close {
    width: 22px; height: 22px; border-radius: 6px;
    background: transparent; border: none; color: var(--text-muted);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.15s; font-size: 0.7rem;
}

.anim-picker-close:hover { background: var(--bg-item); color: var(--text-main); }

.anim-picker-category { margin-bottom: 8px; }

.anim-picker-category-title {
    font-size: 0.6rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--text-muted);
    margin-bottom: 4px; padding-left: 4px;
}

.anim-option {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 8px; border-radius: 8px; cursor: pointer;
    transition: all 0.2s; border: 1px solid transparent; margin-bottom: 2px;
}

.anim-option:hover {
    background: var(--bg-item);
    border-color: var(--border-glass);
    transform: translateX(2px);
}

.anim-option:active { transform: scale(0.98); }

.anim-option-icon {
    width: 28px; height: 28px; border-radius: 7px;
    background: var(--bg-item);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; color: var(--text-muted); flex-shrink: 0;
}

.anim-option:hover .anim-option-icon { color: var(--primary); }

.anim-option-info { flex: 1; min-width: 0; }
.anim-option-name { font-size: 0.72rem; font-weight: 600; color: var(--text-main); }
.anim-option-desc { font-size: 0.55rem; color: var(--text-muted); margin-top: 1px; }

/* =========================================
   SETTINGS POPUP  
   ========================================= */
.anim-settings-popup {
    position: fixed; z-index: 10001;
    background: var(--bg-surface-solid);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 14px; padding: 14px; width: 220px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.4);
    display: none;
    animation: animPickerIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.anim-settings-popup.show { display: block; }

.anim-settings-popup h4 {
    margin: 0 0 10px 0; font-size: 0.78rem; font-weight: 700;
    color: var(--text-main); display: flex; align-items: center; gap: 5px;
}

.anim-settings-popup h4 i { color: var(--primary); }

.anim-setting-group { margin-bottom: 10px; }

.anim-setting-label {
    font-size: 0.6rem; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.06em;
    margin-bottom: 4px; display: block;
}

.anim-setting-select {
    width: 100%; padding: 6px 8px; border-radius: 7px;
    border: 1px solid var(--border-glass);
    background: rgba(0,0,0,0.15); color: var(--text-main);
    font-size: 0.72rem; font-family: inherit; cursor: pointer;
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 6px center;
}

.anim-setting-select:focus { outline: none; border-color: var(--primary); }

.anim-setting-range {
    width: 100%; margin-top: 3px; accent-color: var(--primary);
    height: 3px; cursor: pointer;
}

.anim-setting-value {
    font-size: 0.6rem; color: var(--primary); font-weight: 600;
    text-align: right; margin-top: 1px;
}

.anim-settings-actions {
    display: flex; gap: 6px; margin-top: 10px;
    padding-top: 8px; border-top: 1px solid var(--border-glass);
}

.anim-settings-btn {
    flex: 1; padding: 6px; border-radius: 7px; border: none;
    font-size: 0.68rem; font-weight: 600; cursor: pointer;
    transition: all 0.2s; font-family: inherit;
}

.anim-settings-btn.save {
    background: var(--primary); color: var(--text-on-accent);
}

.anim-settings-btn.save:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(59, 131, 246, 0.3);
}

.anim-settings-btn.cancel {
    background: rgba(255,255,255,0.05); color: var(--text-muted);
    border: 1px solid var(--border-glass);
}
