/* Video Downloader Page — NEONYX */

/* Platforms */
.platforms {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 24px;
}

.platform-tag {
    padding: 5px 14px;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: default;
}

.platform-tag:hover {
    transform: scale(1.12);
    background: rgba(168, 85, 247, 0.25);
    border-color: rgba(168, 85, 247, 0.5);
    color: #a855f7;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.2);
}

.more-tag {
    cursor: pointer;
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

.more-tag:hover {
    background: rgba(168, 85, 247, 0.4);
    transform: scale(1.15);
}

.platforms-hidden {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease, margin 0.4s ease;
    margin-top: 0;
}

.platforms-visible {
    max-height: 200px;
    opacity: 1;
    margin-top: 10px;
}

.platforms-visible .platform-tag {
    animation: fadeInUp 0.3s ease forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.platforms-visible .platform-tag:nth-child(1) { animation-delay: 0.02s; }
.platforms-visible .platform-tag:nth-child(2) { animation-delay: 0.05s; }
.platforms-visible .platform-tag:nth-child(3) { animation-delay: 0.08s; }
.platforms-visible .platform-tag:nth-child(4) { animation-delay: 0.11s; }
.platforms-visible .platform-tag:nth-child(5) { animation-delay: 0.14s; }
.platforms-visible .platform-tag:nth-child(6) { animation-delay: 0.17s; }
.platforms-visible .platform-tag:nth-child(7) { animation-delay: 0.20s; }
.platforms-visible .platform-tag:nth-child(8) { animation-delay: 0.23s; }
.platforms-visible .platform-tag:nth-child(9) { animation-delay: 0.26s; }
.platforms-visible .platform-tag:nth-child(10) { animation-delay: 0.29s; }
.platforms-visible .platform-tag:nth-child(11) { animation-delay: 0.32s; }
.platforms-visible .platform-tag:nth-child(12) { animation-delay: 0.35s; }
.platforms-visible .platform-tag:nth-child(13) { animation-delay: 0.38s; }
.platforms-visible .platform-tag:nth-child(14) { animation-delay: 0.41s; }
.platforms-visible .platform-tag:nth-child(15) { animation-delay: 0.44s; }

/* Form */
.tt-form-wrapper {
    max-width: 640px;
    margin: 30px auto 0;
}

.tt-input-group {
    display: flex;
    gap: 0;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-card);
    transition: border-color 0.3s;
}

.tt-input-group:focus-within {
    border-color: var(--neon-purple);
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.15);
}

.tt-input {
    flex: 1;
    padding: 18px 20px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    outline: none;
}

.tt-input::placeholder { color: var(--text-muted); }

.tt-btn {
    padding: 18px 32px;
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-pink));
    border: none;
    color: white;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.tt-btn:hover { filter: brightness(1.1); }
.tt-btn:disabled { opacity: 0.7; cursor: not-allowed; }

.tt-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Batch */
.batch-toggle {
    margin-top: 12px;
    text-align: center;
}

.toggle-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.toggle-label input[type="checkbox"] {
    accent-color: var(--neon-purple);
    width: 16px;
    height: 16px;
}

.tt-textarea {
    width: 100%;
    padding: 16px;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    resize: vertical;
    transition: border-color 0.3s;
}

.tt-textarea:focus {
    border-color: var(--neon-purple);
}

.tt-textarea::placeholder { color: var(--text-muted); }

/* Status */
.tt-status {
    max-width: 640px;
    margin: 20px auto 0;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 0.9rem;
    text-align: center;
}

.tt-status.loading {
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: var(--neon-purple);
}

.tt-status.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.tt-status.success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

/* Preview Card */
.preview-card {
    max-width: 700px;
    margin: 0 auto;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 28px;
}

.preview-header {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
}

.preview-thumb {
    width: 200px;
    height: 130px;
    object-fit: cover;
    border-radius: 10px;
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.preview-info {
    flex: 1;
    min-width: 0;
}

.platform-badge {
    display: inline-block;
    padding: 3px 10px;
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-pink));
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.preview-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.preview-meta {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 4px;
}

/* Download Options */
.download-options h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.format-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.format-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
}

.format-btn:hover {
    border-color: var(--neon-purple);
    background: rgba(168, 85, 247, 0.05);
}

.format-btn.downloading {
    opacity: 0.6;
    cursor: wait;
}

.format-quality {
    font-weight: 700;
    font-size: 1rem;
    min-width: 70px;
    color: var(--neon-purple);
}

.format-info {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.format-size {
    font-size: 0.85rem;
    color: var(--text-muted);
    min-width: 70px;
    text-align: right;
}

.format-dl {
    font-size: 1.2rem;
    opacity: 0.6;
}

/* Batch */
.batch-list {
    margin-top: 16px;
}

.batch-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.batch-item:last-child { border-bottom: none; }

.batch-status {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.batch-status.pending { background: rgba(168, 85, 247, 0.15); color: var(--neon-purple); }
.batch-status.done { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.batch-status.fail { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

.batch-url {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.batch-link {
    color: var(--neon-purple);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Steps */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.step-card { text-align: center; padding: 30px 20px; }

.step-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-pink));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 800;
    margin: 0 auto 16px;
}

.step-card h4 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.step-card p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; }

@media (max-width: 768px) {
    .tt-input-group { flex-direction: column; }
    .tt-btn { justify-content: center; }
    .steps-grid { grid-template-columns: 1fr; }
    .preview-header { flex-direction: column; }
    .preview-thumb { width: 100%; height: 180px; }
}

/* Server busy overlay */
.busy-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    animation: fadeIn 0.4s ease forwards;
}

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

.busy-ring {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #a855f7;
    border-right-color: #ec4899;
    animation: spin 1.2s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.3), inset 0 0 30px rgba(236, 72, 153, 0.1);
}

.busy-ring::before {
    content: ;
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-bottom-color: #a855f7;
    border-left-color: #ec4899;
    animation: spin 0.8s linear infinite reverse;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.busy-text {
    margin-top: 28px;
    color: #e2e8f0;
    font-size: 1.1rem;
    font-weight: 500;
    text-align: center;
    animation: pulse 2s ease-in-out infinite;
}

.busy-subtext {
    margin-top: 10px;
    color: rgba(168, 85, 247, 0.7);
    font-size: 0.85rem;
}

.busy-retry {
    margin-top: 24px;
    padding: 10px 28px;
    background: linear-gradient(135deg, #a855f7, #ec4899);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    opacity: 0;
    animation: fadeInUp 0.4s ease 3s forwards;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.busy-retry:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.4);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
