/* ===================================
   ESTILOS GENERALES
   =================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --text-main: #1f2937;
    --text-light: #f3f4f6;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --nav-bg-scrolled: rgba(17, 24, 39, 0.95);
    --nav-height: 80px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* ===== NAVBAR FIXED PRO ===== */
.main-nav {
    position: fixed;   /* FIX DEFINITIVO */
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 5000;
    transition: var(--transition);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.main-nav.scrolled {
    background: var(--nav-bg-scrolled);
    height: 70px;
    backdrop-filter: blur(10px);
}

body {
    padding-top: 80px;  /* Compensación navbar fixed */
}

/* ===== NAV CONTAINER ===== */
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ===== LOGO ===== */
.nav-logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

/* ===== MENU ===== */
.nav-list {
    display: flex;
    gap: 5px;
    list-style: none;
    align-items: center;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid transparent;
    background: none;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
}

.nav-link:hover,
.nav-link.active-page {
    background: var(--glass-bg);
    border-color: var(--glass-border);
    color: #fff;
}

/* ===== DROPDOWN DESKTOP ===== */
.nav-item-dropdown { position: relative; }

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 200px;
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    list-style: none;
    z-index: 6000;
}

.nav-item-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(15px);
}

.dropdown-menu a {
    display: block;
    padding: 10px 15px;
    color: var(--text-main);
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.2s;
}

.dropdown-menu a:hover {
    background: #f3f4f6;
    color: var(--primary);
    transform: translateX(5px);
}

/* ===== HAMBURGUESA ===== */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    position: relative;
    z-index: 6001;
}

.burger-line {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    margin: 5px auto;
    transition: var(--transition);
}

.mobile-menu-btn.active .burger-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-menu-btn.active .burger-line:nth-child(2) { opacity: 0; }
.mobile-menu-btn.active .burger-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== OVERLAY ===== */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 4990;
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===== MOBILE MENU ===== */
@media (max-width: 900px) {
    .mobile-menu-btn { display: block; }

    .nav-menu-wrapper {
        position: fixed;
        top: 0;
        right: 0;
        width: 280px;
        height: 100vh;
        background: #fff;
        padding: 80px 20px 20px;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 4995;
        box-shadow: -5px 0 25px rgba(0,0,0,0.1);
        overflow-y: auto;
    }

    .nav-menu-wrapper.active { transform: translateX(0); }

    .nav-list {
        flex-direction: column;
        width: 100%;
        align-items: flex-start;
    }

    .nav-link { 
        color: var(--text-main); 
        width: 100%; 
        justify-content: space-between;
        font-size: 1.1rem;
        padding: 15px;
    }

    .nav-link:hover { background: #f3f4f6; color: var(--primary); }

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: #f9fafb;
        max-height: 0;
        overflow: hidden;
        padding: 0;
        transition: max-height 0.3s ease;
        width: 100%;
    }

    .nav-item-dropdown.open .dropdown-menu {
        max-height: 500px;
        margin-top: 5px;
    }

    .nav-item-dropdown.open .arrow-icon {
        transform: rotate(180deg);
    }
}

/* ===== ADS FIX ===== */
.ad-banner-top,
.ad-sidebar {
    z-index: 10;
}

/* ===== APP LAYER ===== */
#converter-app {
    position: relative;
    z-index: 1;
    overflow: visible;
}

/* ===================================
   CONTENEDOR PRINCIPAL
   =================================== */

#converter-app {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

/* ===================================
   HEADER
   =================================== */

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.2em;
    margin-bottom: 10px;
    font-weight: 700;
}

.header p {
    font-size: 1.1em;
    opacity: 0.95;
    margin-bottom: 15px;
}

.features {
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.feature-badge {
    background: rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    backdrop-filter: blur(10px);
}

/* ===================================
   CONTENIDO PRINCIPAL
   =================================== */

.content {
    padding: 40px;
}

/* ===================================
   ZONA DE ARRASTRE (DRAG & DROP) MEJORADA
   =================================== */

.drop-zone-container {
    position: relative;
    height: 280px; /* Un poco más alto para mayor presencia */
    margin: 30px 0;
    transition: var(--transition);
}

#imageUploader {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 20; /* Asegura que siempre esté clickeable */
}

/* El contenedor visual */
.drop-zone-text {
    position: absolute;
    inset: 0; /* Ocupa todo el espacio */
    border: 3px dashed #cbd5e1; /* Borde gris suave por defecto */
    border-radius: 24px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* Efecto Hover: Cuando pasas el mouse o arrastras un archivo */
.drop-zone-container:hover .drop-zone-text,
#imageUploader:focus + .drop-zone-text,
#imageUploader:active + .drop-zone-text {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.04); /* Color primario muy suave */
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.15);
}

/* Icono Animado */
.upload-icon {
    font-size: 4.5em;
    margin-bottom: 20px;
    filter: drop-shadow(0 10px 10px rgba(0,0,0,0.1));
    transition: transform 0.4s ease;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.drop-zone-container:hover .upload-icon {
    transform: scale(1.1) rotate(-5deg);
    animation: bounce 1s infinite alternate;
}

/* Textos */
.drop-zone-text strong {
    font-size: 1.5em;
    color: var(--text-main);
    margin-bottom: 10px;
    font-weight: 800;
}

.drop-zone-text span {
    color: #64748b;
    font-size: 1rem;
    background: white;
    padding: 8px 20px;
    border-radius: 50px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    font-weight: 500;
}

/* Animación de rebote suave */
@keyframes bounce {
    from { transform: translateY(0) scale(1.1); }
    to { transform: translateY(-10px) scale(1.1); }
}

/* ESTADO CUANDO SUELTAS EL ARCHIVO (Para JS si quieres agregarlo después) */
.drop-zone-text.dragover {
    border-color: #10b981; /* Verde éxito */
    background: rgba(16, 185, 129, 0.05);
}
/* ===================================
   LISTA DE ARCHIVOS
   =================================== */

#fileList {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    max-height: 200px;
    overflow-y: auto;
}

#fileList li {
    background: #f8f9ff;
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    font-size: 0.95em;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===================================
   OPCIONES DE CONVERSIÓN
   =================================== */

#options {
    background: #f8f9ff;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.option-group {
    margin-bottom: 20px;
}

.option-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

select, input[type="range"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

select:focus, input[type="range"]:focus {
    outline: none;
    border-color: #667eea;
}

.quality-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

#qualityValue {
    font-size: 1.5em;
    font-weight: 700;
    color: #667eea;
}

/* ===================================
   BOTONES
   =================================== */

button {
    width: 100%;
    padding: 16px;
    font-size: 1.1em;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#downloadAllButton {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

#downloadAllButton:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

#downloadAllButton:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    box-shadow: none;
}

/* ===================================
   CONTADOR Y MENSAJES
   =================================== */

#processedCounter {
    text-align: center;
    font-size: 1.1em;
    font-weight: 600;
    color: #667eea;
    margin: 15px 0;
}

#message {
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 15px;
}

.success {
    background: #d4edda;
    color: #155724;
}

.processing {
    background: #fff3cd;
    color: #856404;
}

/* ===================================
   SECCIÓN DE BENEFICIOS
   =================================== */

.benefits {
    background: #f8f9ff;
    padding: 30px;
    border-radius: 12px;
    margin-top: 30px;
}

.benefits h3 {
    text-align: center;
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.benefit-item {
    text-align: center;
    padding: 20px;
}

.benefit-item .icon {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.benefit-item h4 {
    color: #333;
    margin-bottom: 8px;
}

.benefit-item p {
    color: #666;
    font-size: 0.9em;
}

/* ===================================
   FOOTER
   =================================== */

.footer {
    background: #2c3e50;
    color: white;
    padding: 30px;
    text-align: center;
    margin-top: 30px;
}

.cta-button {
    display: inline-block;
    margin: 15px auto;
    padding: 12px 30px;
    background: #27ae60;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
}

.cta-button:hover {
    background: #229954;
    transform: translateY(-2px);
}

/* ===================================
   CANVAS OCULTO
   =================================== */

canvas {
    display: none;
}

/* ===================================
   RESPONSIVE (MÓVILES Y TABLETS)
   =================================== */

@media (max-width: 768px) {
    .ad-sidebar {
        display: none;
    }
    
    .header h1 {
        font-size: 1.6em;
    }
    
    .features {
        gap: 10px;
    }
    
    .feature-badge {
        font-size: 0.8em;
        padding: 6px 12px;
    }
    
    .content {
        padding: 20px;
    }
    
    .benefits-grid {
        grid-template-columns: 1fr;
    }
    
    .ad-banner-top {
        height: 50px;
        font-size: 0.7em;
    }
}

/* ===================================
   SECCIÓN CÓMO FUNCIONA
   =================================== */

.how-it-works {
    background: white;
    padding: 40px 30px;
    border-radius: 12px;
    margin-top: 30px;
    border: 2px solid #e8edff;
}

.how-it-works h3 {
    text-align: center;
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.8em;
}

.how-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1em;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.step-item {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f3ff 100%);
    border-radius: 12px;
    position: relative;
    transition: transform 0.3s;
}

.step-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.15);
}

.step-number {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.3em;
}

.step-icon {
    font-size: 4em;
    margin-bottom: 15px;
}

.step-item h4 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.step-item p {
    color: #666;
    line-height: 1.6;
}

.privacy-note {
    background: #e8f5e9;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #27ae60;
    text-align: center;
    color: #2c5f2d;
    font-size: 1.05em;
}

@media (max-width: 768px) {
    .steps-grid {
        grid-template-columns: 1fr;
    }
}

/* ===================================
   SECCIÓN FAQ
   =================================== */

.faq-section {
    background: white;
    padding: 40px 30px;
    border-radius: 12px;
    margin-top: 30px;
}

.faq-section h3 {
    text-align: center;
    color: #667eea;
    margin-bottom: 30px;
    font-size: 1.8em;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: #f8f9ff;
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e8edff;
    transition: all 0.3s;
}

.faq-item:hover {
    border-color: #667eea;
}

.faq-question {
    padding: 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #333;
    font-size: 1.1em;
    user-select: none;
}

.faq-toggle {
    font-size: 1.5em;
    color: #667eea;
    font-weight: bold;
    transition: transform 0.3s;
}

.faq-item.active .faq-toggle {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

.faq-answer p {
    padding: 0 20px 20px 20px;
    color: #555;
    line-height: 1.8;
}