/**
 * VIDEO DOWNLOADER STYLES
 * Diseño futurista oscuro con efectos de neón
 */

/* ═══════════════════════════════════════════════════════════
   📹 CONTENEDOR PRINCIPAL
   ═══════════════════════════════════════════════════════════ */
.video-downloader-container {
    padding: 30px;
    max-width: 1800px;
    margin: 0 auto;
    min-height: calc(100vh - 120px);
}

/* ═══════════════════════════════════════════════════════════
   🎯 TÍTULO PRINCIPAL
   ═══════════════════════════════════════════════════════════ */
.section-title-main {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    text-align: center;
    justify-content: center;
}

.title-icon {
    font-size: 2.8rem;
    animation: float3D 3s ease-in-out infinite;
}

.title-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(0, 255, 136, 0.3);
}

.section-subtitle {
    color: var(--text-secondary);
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 40px;
    font-weight: 400;
}

/* ═══════════════════════════════════════════════════════════
   📱 SELECTOR DE PLATAFORMA
   ═══════════════════════════════════════════════════════════ */
.platform-selector {
    margin-bottom: 40px;
}

.platform-tabs {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.platform-tab {
    background: var(--bg-card);
    border: 2px solid var(--border);
    padding: 16px 32px;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
}

.platform-tab::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.platform-tab:hover {
    transform: translateY(-3px);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-neon);
}

.platform-tab.active {
    border-color: var(--primary);
    color: var(--text-primary);
    box-shadow: var(--primary-glow);
}

.platform-tab.active::before {
    opacity: 0.1;
}

.platform-icon {
    font-size: 1.4rem;
    position: relative;
    z-index: 1;
}

.platform-tab span:last-child {
    position: relative;
    z-index: 1;
}

/* ═══════════════════════════════════════════════════════════
   📦 CONTENEDOR DE DESCARGA
   ═══════════════════════════════════════════════════════════ */
.download-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
    align-items: start;
}

.download-main {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 35px;
    box-shadow: var(--shadow-soft);
}

/* ═══════════════════════════════════════════════════════════
   🔗 INPUT DE URL
   ═══════════════════════════════════════════════════════════ */
.url-input-section {
    margin-bottom: 35px;
}

.subtitle-icon {
    font-size: 1.3rem;
    margin-right: 8px;
}

.url-input-group {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.input-wrapper {
    flex: 1;
    position: relative;
}

.url-input {
    width: 100%;
    background: rgba(10, 10, 10, 0.8);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 50px 16px 20px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.url-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.2);
}

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

.btn-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 0, 0, 0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #ff4444;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-weight: bold;
}

.btn-clear:hover {
    background: rgba(255, 0, 0, 0.4);
    transform: translateY(-50%) scale(1.1);
}

.btn-fetch {
    padding: 16px 35px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-icon {
    font-size: 1.2rem;
}

/* ═══════════════════════════════════════════════════════════
   💡 TIPS DE PLATAFORMA
   ═══════════════════════════════════════════════════════════ */
.platform-tips {
    margin-top: 20px;
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: var(--radius-sm);
    padding: 20px;
}

.tip-item {
    display: flex;
    gap: 15px;
    color: var(--text-secondary);
}

.tip-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.tip-item strong {
    color: var(--primary);
    display: block;
    margin-bottom: 10px;
}

.tip-item ol {
    margin: 10px 0 0 20px;
    line-height: 1.8;
}

.tip-item li {
    margin-bottom: 5px;
}

/* ═══════════════════════════════════════════════════════════
   ℹ️ INFORMACIÓN DEL VIDEO
   ═══════════════════════════════════════════════════════════ */
.video-info-section {
    margin-top: 30px;
    animation: slideIn 0.5s ease-out;
}

.video-info-section.hidden {
    display: none;
}

.video-preview-card {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 25px;
    background: rgba(10, 10, 10, 0.6);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 20px;
    margin-bottom: 30px;
}

.video-thumbnail {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 9/16;
    background: var(--bg-secondary);
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 0.85rem;
    font-weight: 600;
}

.video-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.video-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.4;
}

.video-meta {
    display: flex;
    gap: 20px;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.video-author {
    color: var(--primary);
    font-weight: 600;
}

.video-views::before {
    content: '•';
    margin-right: 10px;
    color: var(--text-muted);
}

.video-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
    max-height: 100px;
    overflow-y: auto;
}

/* ═══════════════════════════════════════════════════════════
   ⚙️ OPCIONES DE DESCARGA
   ═══════════════════════════════════════════════════════════ */
.download-options {
    background: rgba(10, 10, 10, 0.4);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 25px;
    margin-bottom: 25px;
}

.options-title {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 20px 0;
}

.quality-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.quality-option {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.quality-option input[type="radio"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 50%;
    margin-right: 15px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quality-option input[type="radio"]:checked {
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
}

.quality-option input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: black;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.quality-label {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-secondary);
    font-weight: 500;
}

.quality-option:hover .quality-label {
    color: var(--text-primary);
}

.quality-badge {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: black;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 50px;
    text-align: center;
}

.download-option-extras {
    display: flex;
    gap: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.checkbox-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 500;
}

.checkbox-option input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkbox-option input[type="checkbox"]:checked {
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

.checkbox-option input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    color: black;
    font-size: 14px;
    font-weight: bold;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* ═══════════════════════════════════════════════════════════
   🎬 BOTONES DE ACCIÓN
   ═══════════════════════════════════════════════════════════ */
.download-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.btn-download,
.btn-success {
    flex: 1;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    color: #000;
    padding: 16px 30px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: var(--primary-glow);
}

.btn-download:hover,
.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.6);
}

/* ═══════════════════════════════════════════════════════════
   📊 BARRA DE PROGRESO
   ═══════════════════════════════════════════════════════════ */
.download-progress {
    background: rgba(10, 10, 10, 0.6);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    animation: slideIn 0.3s ease-out;
}

.download-progress.hidden {
    display: none;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.progress-percent {
    color: var(--primary);
    font-size: 1.1rem;
}

.progress-bar {
    height: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 5px;
    transition: width 0.3s ease;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ═══════════════════════════════════════════════════════════
   ✨ CARACTERÍSTICAS
   ═══════════════════════════════════════════════════════════ */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.feature-card {
    background: rgba(10, 10, 10, 0.6);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-neon);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.feature-card h4 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin: 0 0 10px 0;
}

.feature-card p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════════════════
   📋 SIDEBAR - HISTORIAL
   ═══════════════════════════════════════════════════════════ */
.download-sidebar {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 25px;
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-soft);
}

.sidebar-title {
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.download-history {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    min-height: 300px;
}

.empty-history {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 60px 20px;
    color: var(--text-muted);
    text-align: center;
}

.empty-icon {
    font-size: 4rem;
    opacity: 0.5;
}

.empty-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(10, 10, 10, 0.4);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 15px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.history-item:hover {
    border-color: var(--border-glow);
    transform: translateX(5px);
}

.history-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.history-details {
    flex: 1;
    min-width: 0;
}

.history-title {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-meta {
    display: flex;
    gap: 10px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.history-type {
    color: var(--primary);
}

.history-redownload {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid var(--primary);
    color: var(--primary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.history-redownload:hover {
    background: var(--primary);
    color: black;
    transform: rotate(180deg);
}

.btn-clear-history {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
}

/* ═══════════════════════════════════════════════════════════
   💡 INFO BOX
   ═══════════════════════════════════════════════════════════ */
.info-box {
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: var(--radius-sm);
    padding: 20px;
}

.info-box h4 {
    color: var(--accent);
    font-size: 1rem;
    margin: 0 0 15px 0;
    font-weight: 700;
}

.info-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-box li {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
    line-height: 1.5;
}

.info-box li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════
   📱 RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1400px) {
    .download-container {
        grid-template-columns: 1fr;
    }

    .download-sidebar {
        position: relative;
        top: 0;
        max-height: none;
    }

    .video-preview-card {
        grid-template-columns: 1fr;
    }

    .video-thumbnail {
        aspect-ratio: 16/9;
    }
}

@media (max-width: 768px) {
    .video-downloader-container {
        padding: 15px;
    }

    .section-title-main {
        font-size: 2rem;
    }

    .platform-tabs {
        gap: 10px;
    }

    .platform-tab {
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    .url-input-group {
        flex-direction: column;
    }

    .btn-fetch {
        width: 100%;
        justify-content: center;
    }

    .download-actions {
        flex-direction: column;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .download-option-extras {
        flex-direction: column;
        gap: 15px;
    }
}

/* ═══════════════════════════════════════════════════════════
   🎯 SCROLLBAR CUSTOM
   ═══════════════════════════════════════════════════════════ */
.download-history::-webkit-scrollbar {
    width: 6px;
}

.download-history::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 3px;
}

.download-history::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.download-history::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

.video-description::-webkit-scrollbar {
    width: 4px;
}

.video-description::-webkit-scrollbar-track {
    background: transparent;
}

.video-description::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}
