/* ==========================================================================
   RESET Y BASE
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
}

/* ==========================================================================
   HEADER / NAVEGACIÓN
   ========================================================================== */
.header {
    background: white;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.8em;
    font-weight: 700;
    color: #2c3e50;
    gap: 10px;
}

.logo i {
    color: #217346;
    font-size: 1.2em;
}

.logo-dot {
    color: #217346;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
    align-items: center;
}

.nav-links a {
    color: #555;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    position: relative;
}

.nav-links a:hover {
    color: #217346;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #217346;
    transition: width 0.3s;
}

.nav-links a:hover::after {
    width: 100%;
}

.btn-try {
    background: linear-gradient(135deg, #217346, #2ecc71);
    color: white !important;
    padding: 10px 25px !important;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(33, 115, 70, 0.3);
}

.btn-try:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 115, 70, 0.4);
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero {
    padding: 80px 0;
    text-align: center;
    background: white;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, rgba(33, 115, 70, 0.1), rgba(46, 204, 113, 0.1));
    border-radius: 50%;
    transform: translate(100px, -100px);
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, rgba(33, 115, 70, 0.1), rgba(46, 204, 113, 0.1));
    border-radius: 50%;
    transform: translate(-50px, 50px);
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3em;
    color: #2c3e50;
    margin-bottom: 20px;
    line-height: 1.2;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 1.2em;
    color: #666;
    max-width: 600px;
    margin: 0 auto 30px;
    font-weight: 400;
}

.alert {
    background: #fff9e6;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin: 30px auto;
    max-width: 600px;
    border-radius: 8px;
    text-align: left;
    position: relative;
}

.alert i {
    color: #ffc107;
    margin-right: 10px;
    font-size: 1.2em;
}

.alert strong {
    color: #e67e22;
}

.alert a {
    color: #217346;
    font-weight: 600;
}

.alert a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   BOTONES
   ========================================================================== */
.btn-primary {
    display: inline-block;
    background: linear-gradient(135deg, #217346, #2ecc71);
    color: white;
    padding: 15px 40px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2ecc71, #217346);
    transition: left 0.3s;
    z-index: -1;
}

.btn-primary:hover::before {
    left: 0;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(33, 115, 70, 0.3);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f8f9fa;
    color: #555;
    border: 2px solid #ddd;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: #e9ecef;
    border-color: #bbb;
    transform: translateY(-2px);
}

.btn-secondary:active {
    transform: translateY(0);
}

/* ==========================================================================
   CONVERTIDOR
   ========================================================================== */
.converter {
    background: white;
    border-radius: 20px;
    padding: 50px;
    margin-bottom: 50px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1;
}

.converter h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 2.2em;
    font-weight: 700;
}

.converter h2 i {
    color: #217346;
    margin-right: 10px;
}

.section-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 40px;
    font-size: 1.1em;
}

.upload-area {
    border: 3px dashed #217346;
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    background: #f8fff9;
    margin: 20px 0;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.upload-area:hover {
    background: #e8f7ed;
    border-color: #2ecc71;
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(33, 115, 70, 0.15);
}

.upload-icon {
    font-size: 3em;
    color: #217346;
    margin-bottom: 20px;
    transition: transform 0.3s;
}

.upload-area:hover .upload-icon {
    transform: scale(1.1);
}

.upload-area h3 {
    font-size: 1.5em;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 600;
}

.upload-area p {
    color: #666;
    margin-bottom: 5px;
}

.formats {
    color: #777;
    font-size: 0.9em;
    margin-top: 10px;
    font-style: italic;
}

/* ==========================================================================
   PREVIEW DE IMÁGENES
   ========================================================================== */
.preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 30px 0;
    min-height: 100px;
    justify-content: center;
}

.image-preview {
    position: relative;
    width: 150px;
    height: 150px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.image-preview:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 8px;
    font-size: 0.8em;
    display: flex;
    justify-content: space-between;
}

.remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #e74c3c;
    color: white;
    border: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.remove-btn:hover {
    background: #c0392b;
}

/* ==========================================================================
   ACCIONES
   ========================================================================== */
.actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
    flex-wrap: wrap;
}

/* ==========================================================================
   BARRA DE PROGRESO
   ========================================================================== */
.progress-container {
    background: #f8f9fa;
    border-radius: 10px;
    height: 20px;
    margin: 30px 0;
    overflow: hidden;
    display: none;
    position: relative;
}

.progress-bar {
    background: linear-gradient(90deg, #217346, #2ecc71);
    height: 100%;
    width: 0%;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 50px 50px;
    animation: move 2s linear infinite;
}

@keyframes move {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 50px 50px;
    }
}

.progress-text {
    text-align: center;
    padding: 10px;
    color: #666;
    font-size: 0.9em;
    font-weight: 500;
}

/* ==========================================================================
   MENSAJES DE ESTADO
   ========================================================================== */
.status-message {
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
    font-weight: 500;
    display: none;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.status-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.status-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.status-message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    display: block;
}

.status-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    display: block;
}

/* ==========================================================================
   ENLACE DE DESCARGA
   ========================================================================== */
.download-link {
    display: block;
    background: linear-gradient(135deg, #217346, #2ecc71);
    color: white;
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1.2em;
    margin-top: 30px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.download-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2ecc71, #217346);
    transition: left 0.3s;
}

.download-link:hover::before {
    left: 0;
}

.download-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(33, 115, 70, 0.3);
}

.download-link i {
    margin-right: 10px;
}

.download-link span {
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   CARACTERÍSTICAS
   ========================================================================== */
.features {
    background: #f8f9fa;
    padding: 60px 0;
    margin: 40px 0;
    position: relative;
}

.features h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 40px;
    font-size: 2.2em;
    font-weight: 700;
}

.features h2 i {
    color: #217346;
    margin-right: 10px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.feature-card {
    background: white;
    padding: 40px 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #217346, #2ecc71);
    transform: scaleX(0);
    transition: transform 0.3s;
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

.feature-card i {
    font-size: 2.5em;
    color: #217346;
    margin-bottom: 20px;
    transition: transform 0.3s;
}

.feature-card:hover i {
    transform: scale(1.1);
}

.feature-card h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.4em;
    font-weight: 600;
}

.feature-card p {
    color: #666;
    font-size: 0.95em;
    line-height: 1.5;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
    background: #2c3e50;
    color: white;
    padding: 50px 0 30px;
    text-align: center;
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #217346, #2ecc71);
}

.footer p {
    margin-bottom: 15px;
    color: #ecf0f1;
}

.footer-links {
    margin: 30px 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-links a {
    color: #bdc3c7;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    border-radius: 5px;
    transition: all 0.3s;
}

.footer-links a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

.disclaimer {
    font-size: 0.9em;
    color: #95a5a6;
    max-width: 800px;
    margin: 30px auto 0;
    font-style: italic;
    border-top: 1px solid #34495e;
    padding-top: 20px;
    line-height: 1.5;
}

/* ==========================================================================
   NOFOLLOW PARA ENLACES EXTERNOS
   ========================================================================== */
a[rel="noopener noreferrer"],
a[rel="nofollow"] {
    color: #217346;
    font-weight: 600;
    position: relative;
}

a[rel="noopener noreferrer"]::after,
a[rel="nofollow"]::after {
    content: '↗';
    font-size: 0.8em;
    margin-left: 3px;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 992px) {
    .hero-title {
        font-size: 2.5em;
    }
    
    .converter {
        padding: 40px 30px;
    }
    
    .features-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.2em;
    }
    
    .hero-subtitle {
        font-size: 1.1em;
    }
    
    .navbar {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
    
    .converter {
        padding: 30px 20px;
        margin: 0 10px 40px;
        border-radius: 15px;
    }
    
    .converter h2 {
        font-size: 1.8em;
    }
    
    .upload-area {
        padding: 40px 15px;
    }
    
    .upload-area h3 {
        font-size: 1.3em;
    }
    
    .actions {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        max-width: 300px;
        text-align: center;
    }
    
    .features {
        padding: 40px 0;
    }
    
    .features h2 {
        font-size: 1.8em;
    }
    
    .feature-card {
        padding: 30px 20px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.8em;
    }
    
    .hero {
        padding: 50px 0;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .logo {
        font-size: 1.5em;
    }
    
    .converter h2 {
        font-size: 1.6em;
    }
    
    .image-preview {
        width: 120px;
        height: 120px;
    }
    
    .download-link {
        padding: 15px;
        font-size: 1em;
    }
}

/* ==========================================================================
   ANIMACIONES ADICIONALES
   ========================================================================== */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(33, 115, 70, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(33, 115, 70, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(33, 115, 70, 0);
    }
}

.btn-primary.loading {
    animation: pulse 1.5s infinite;
}

/* ==========================================================================
   SCROLLBAR PERSONALIZADA
   ========================================================================== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #217346, #2ecc71);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #1a5c38, #27ae60);
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.hidden { display: none; }
.fade-in { animation: fadeIn 0.5s ease; }

/* ==========================================================================
   LOADING SPINNER
   ========================================================================== */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

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