/* YT-DL Server Frontend Styles */

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #4d4d4d;
}

/* Textarea scrollbar */
textarea::-webkit-scrollbar {
    width: 6px;
}

/* Selection color */
::selection {
    background: rgba(220, 38, 38, 0.3);
    color: #fff;
}

/* Download item styles */
.download-item {
    background: #1a1a1a;
    border: 1px solid #2d2d2d;
    border-radius: 0.75rem;
    padding: 1rem;
    transition: all 0.2s ease;
}

.download-item:hover {
    border-color: #3d3d3d;
    background: #1f1f1f;
}

.download-item.complete {
    border-left: 3px solid #22c55e;
}

.download-item.failed {
    border-left: 3px solid #ef4444;
}

.download-item.processing {
    border-left: 3px solid #eab308;
}

/* Progress bar */
.progress-bar {
    height: 4px;
    background: #2d2d2d;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.75rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #dc2626, #ef4444);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.progress-fill.complete {
    background: linear-gradient(90deg, #16a34a, #22c55e);
}

/* Status badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.pending {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
}

.status-badge.processing {
    background: rgba(234, 179, 8, 0.2);
    color: #fbbf24;
}

.status-badge.downloading {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.status-badge.complete {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.status-badge.failed {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* Pulse animation for active downloads */
@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.pulse-dot {
    animation: pulse-dot 1.5s ease-in-out infinite;
}

/* Copy button animation */
.copy-btn {
    transition: all 0.2s ease;
}

.copy-btn:hover {
    transform: scale(1.05);
}

.copy-btn.copied {
    background: #22c55e !important;
    color: white !important;
}

/* Toast notifications */
.toast {
    background: #1a1a1a;
    border: 1px solid #2d2d2d;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    animation: slide-in 0.3s ease;
    max-width: 350px;
}

.toast.success {
    border-left: 3px solid #22c55e;
}

.toast.error {
    border-left: 3px solid #ef4444;
}

.toast.info {
    border-left: 3px solid #3b82f6;
}

@keyframes slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast.hiding {
    animation: slide-out 0.3s ease forwards;
}

/* Thumbnail placeholder */
.thumbnail-placeholder {
    width: 80px;
    height: 45px;
    background: linear-gradient(135deg, #2d2d2d, #1a1a1a);
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.thumbnail-img {
    width: 80px;
    height: 45px;
    object-fit: cover;
    border-radius: 0.375rem;
    flex-shrink: 0;
}

/* Action buttons */
.action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2d2d2d;
    border-radius: 0.375rem;
    color: #9ca3af;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.action-btn:hover {
    background: #3d3d3d;
    color: #fff;
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading spinner - smooth continuous rotation */
.spinner {
    width: 18px;
    height: 18px;
    position: relative;
    display: inline-block;
}

.spinner::before {
    content: '';
    box-sizing: border-box;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid #3d3d3d;
    border-radius: 50%;
}

.spinner::after {
    content: '';
    box-sizing: border-box;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid transparent;
    border-top-color: #dc2626;
    border-radius: 50%;
    animation: spinner-rotate 0.8s linear infinite;
}

@keyframes spinner-rotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .download-item {
        padding: 0.75rem;
    }

    .thumbnail-placeholder,
    .thumbnail-img {
        width: 60px;
        height: 34px;
    }
}

/* Virtual scroll optimization - minimal reflow */
.download-item {
    contain: layout style;
    will-change: transform;
}