/* Importar fuentes modernas */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Variables CSS para colores y efectos */
:root {
    --primary-color: #667eea;
    --primary-dark: #5a6fd8;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --text-primary: #ffffff;
    --text-secondary: #e2e8f0;
    --text-muted: #94a3b8;
    --bg-primary: rgba(15, 23, 42, 0.95);
    --bg-secondary: rgba(30, 41, 59, 0.8);
    --bg-card: rgba(51, 65, 85, 0.6);
    --border-color: rgba(148, 163, 184, 0.2);
    --shadow-light: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-heavy: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
}

/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* Fondo animado con partículas */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 119, 198, 0.2) 0%, transparent 50%);
    animation: backgroundShift 20s ease-in-out infinite;
    z-index: -1;
}

@keyframes backgroundShift {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(1deg); }
}

/* Contenedor principal */
.contenedor {
    background: var(--bg-primary);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    width: 100%;
    max-width: 600px;
    box-shadow: var(--shadow-heavy);
    position: relative;
    overflow: hidden;
}

.contenedor::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Título principal */
h1 {
    margin-bottom: 32px;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(240, 147, 251, 0.3);
    letter-spacing: -0.02em;
}

/* Input de archivo oculto */
input[type="file"] {
    display: none;
}

/* Botón de carga de imagen */
label {
    display: inline-block;
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 16px;
    cursor: pointer;
    margin-bottom: 24px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-medium);
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
}

label::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

label:hover::before {
    left: 100%;
}

label:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-heavy);
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary-color) 100%);
}

/* Zona de pegado */
.zona-pegado {
    border: 2px dashed var(--border-color);
    padding: 40px;
    border-radius: 20px;
    margin-bottom: 32px;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-primary);
    font-size: 1rem;
    min-height: 160px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border-radius: 20px;
    overflow: hidden;
}

.zona-pegado::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.zona-pegado:hover::before {
    opacity: 1;
}

.zona-pegado.drag-over {
    border-color: var(--accent-color);
    background: var(--bg-secondary);
    transform: scale(1.02);
    box-shadow: 0 0 30px rgba(240, 147, 251, 0.3);
}

.zona-pegado.con-imagen {
    cursor: default;
    border-style: solid;
    border-color: var(--primary-color);
}

/* Instrucciones */
.instrucciones {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    z-index: 1;
    position: relative;
}

.instrucciones p {
    margin: 8px 0;
    transition: color 0.3s ease;
}

.zona-pegado:hover .instrucciones p {
    color: var(--text-secondary);
}

/* Imagen en la zona de pegado */
.zona-pegado img {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: 16px;
    border: 2px solid var(--glass-border);
    margin: 16px 0;
    box-shadow: var(--shadow-medium);
    transition: all 0.3s ease;
}

.zona-pegado img:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-heavy);
}

.zona-pegado.con-imagen .instrucciones {
    display: none;
}

/* Contenedor de botones */
.botones-accion {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 32px;
    flex-wrap: wrap;
}

.botones-accion button {
    flex: 1;
    min-width: 180px;
    max-width: 220px;
}

/* Botones */
button {
    padding: 16px 32px;
    border: none;
    background: linear-gradient(135deg, var(--glass-bg) 0%, rgba(255, 255, 255, 0.15) 100%);
    color: var(--text-primary);
    border-radius: 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

button:hover::before {
    left: 100%;
}

button:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-heavy);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.3) 100%);
}

button:disabled {
    background: rgba(148, 163, 184, 0.3);
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

button:disabled:hover {
    transform: none;
    box-shadow: var(--shadow-light);
}

/* Área de resultado */
pre {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 24px;
    border-radius: 16px;
    text-align: left;
    white-space: pre-wrap;
    margin-top: 32px;
    max-height: 400px;
    overflow-y: auto;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    box-shadow: var(--shadow-medium);
    transition: all 0.3s ease;
}

pre:hover {
    box-shadow: var(--shadow-heavy);
    transform: translateY(-2px);
}

/* Scrollbar personalizado */
pre::-webkit-scrollbar {
    width: 8px;
}

pre::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

pre::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
}

pre::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary-color));
}

/* Responsive */
@media (max-width: 768px) {
    .contenedor {
        padding: 24px;
        margin: 10px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .zona-pegado {
        padding: 24px;
        min-height: 120px;
    }
    
    .botones-accion {
        flex-direction: column;
        align-items: center;
    }
    
    .botones-accion button {
        min-width: 200px;
        max-width: none;
    }
}

/* Animaciones de entrada */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.contenedor {
    animation: fadeInUp 0.6s ease-out;
}

/* Efectos de hover para elementos interactivos */
.zona-pegado, button, label {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Efecto de brillo en hover */
.zona-pegado:hover, button:hover, label:hover {
    box-shadow: 0 0 20px rgba(240, 147, 251, 0.2);
}

