/* Custom Animations */
@keyframes float {
    0%, 100% { transform: translateY(0px) translateX(0px); }
    33% { transform: translateY(-30px) translateX(15px); }
    66% { transform: translateY(-15px) translateX(-10px); }
}

@keyframes glow {
    0% { box-shadow: 0 0 20px rgba(239, 68, 68, 0.15); }
    100% { box-shadow: 0 0 40px rgba(239, 68, 68, 0.35); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #0f0f0f;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Smooth Transitions */
* {
    transition: background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

/* Chapter Item Hover */
.chapter-item {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.chapter-item:hover {
    border-color: rgba(239, 68, 68, 0.3);
    background-color: rgba(239, 68, 68, 0.03);
}

.chapter-item:hover .chapter-drag-handle {
    opacity: 1;
}

.chapter-drag-handle {
    opacity: 0.3;
    transition: opacity 0.2s ease;
}

/* Generate button pulse animation */
.generating {
    animation: glow 1s ease-in-out infinite alternate;
}

/* Toast animation */
.toast-enter {
    animation: slideUp 0.3s ease-out;
}

/* Input focus glow */
input:focus, textarea:focus, select:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Timestamp badge */
.timestamp-badge {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
}

/* Skeleton loading for generation */
.skeleton {
    background: linear-gradient(90deg, #1a1a1a 25%, #252525 50%, #1a1a1a 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
    border-radius: 8px;
}

/* Responsive textarea */
@media (max-width: 640px) {
    textarea {
        font-size: 16px !important; /* Prevent zoom on iOS */
    }
}

/* Chapter edit input */
.chapter-edit-input {
    background: transparent;
    border: none;
    outline: none;
    color: white;
    width: 100%;
    font-size: inherit;
    font-family: inherit;
}

.chapter-edit-input:focus {
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    padding: 2px 6px;
}

/* Time edit input */
.time-edit-input {
    background: transparent;
    border: 1px solid transparent;
    outline: none;
    color: #ef4444;
    width: 60px;
    font-size: 14px;
    font-family: 'Inter', monospace;
    font-variant-numeric: tabular-nums;
    text-align: center;
    border-radius: 4px;
    padding: 2px 4px;
}

.time-edit-input:focus {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.05);
}

/* Remove button */
.remove-chapter-btn {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.chapter-item:hover .remove-chapter-btn {
    opacity: 1;
}