:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --error-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.18);
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--primary-gradient);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px 20px;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.container {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    padding: 80px 48px;
    max-width: 680px;
    width: 100%;
    position: relative;
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.header {
    text-align: center;
    margin-bottom: 48px;
    position: relative;
}

/* Información del usuario logueado */
.user-info {
    position: absolute;
    top: -60px;
    right: 0;
}

.user-welcome {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.1);
    z-index: 1000;
}

.welcome-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: #667eea;
    font-weight: 500;
}

.welcome-message i {
    color: #10b981;
    font-size: 1.1rem;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-btn {
    background: #f59e0b;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.admin-btn:hover {
    background: #d97706;
    transform: scale(1.05);
}

.logout-btn {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.logout-btn:hover {
    background: #dc2626;
    transform: scale(1.05);
}

.header .logo {
    width: 120px;
    height: 120px;
    background: var(--primary-gradient);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    padding: 8px;
}

.header .logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 16px;
}

.header .logo i {
    font-size: 2.5rem;
    color: white;
}

.header h1 {
    color: var(--text-primary);
    font-size: 2.75rem;
    font-weight: 700;
    margin-bottom: 12px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.header p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    line-height: 1.6;
    font-weight: 400;
}

.form-group {
    margin-bottom: 32px;
    position: relative;
}

.form-group label {
    display: flex;
    align-items: center;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.form-group label i {
    margin-right: 12px;
    color: #667eea;
    font-size: 1.2rem;
}

.file-upload-area {
    border: 2px dashed #cbd5e0;
    border-radius: 20px;
    padding: 48px 24px;
    text-align: center;
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.file-upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.file-upload-area:hover::before {
    left: 100%;
}

.file-upload-area:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.file-upload-area.dragover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    transform: scale(1.02);
}

.file-upload-icon {
    font-size: 4rem;
    color: #667eea;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.file-upload-text {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.file-upload-subtext {
    color: var(--text-muted);
    font-size: 1rem;
}

#upload_product {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.input-group {
    position: relative;
}

.input-group input {
    width: 100%;
    padding: 20px 24px;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-primary);
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    background: rgba(255, 255, 255, 0.95);
}

.input-group input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.submit-btn {
    width: 100%;
    padding: 20px 24px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.submit-btn::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;
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

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

.submit-btn i {
    margin-right: 12px;
}

.preview-area {
    margin-top: 24px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    display: none;
    animation: fadeIn 0.5s ease-out;
}

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

.preview-image {
    max-width: 100%;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.loading {
    display: none;
    text-align: center;
    padding: 32px;
    animation: pulse 2s ease-in-out infinite;
}

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

.loading i {
    font-size: 3rem;
    color: #667eea;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

.loading p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 500;
}

.message {
    padding: 20px 24px;
    border-radius: 16px;
    text-align: center;
    margin-top: 24px;
    font-weight: 500;
    display: none;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.success-message {
    background: var(--success-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

.error-message {
    background: var(--error-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.feature {
    text-align: center;
    padding: 24px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.feature:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-lg);
}

.feature i {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

/* Colores específicos para cada red social */
.feature:nth-child(1) i {
    color: #E4405F; /* Instagram */
}

.feature:nth-child(2) i {
    color: #1877F2; /* Facebook */
}

.feature:nth-child(3) i {
    color: #1DA1F2; /* Twitter */
}

.feature:nth-child(4) i {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.feature h3 {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
}

.footer {
    text-align: center;
    margin-top: 32px;
    padding: 24px 20px;
    border-top: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

.footer p {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.95;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    margin: 0;
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    .form-card {
        padding: 32px 24px;
    }
    
    .features {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .feature {
        padding: 24px 20px;
    }
    
    /* Responsive para info de usuario */
    .user-info {
        position: static;
        margin-bottom: 20px;
        text-align: center;
    }
    
    body {
        padding: 60px 20px 20px;
    }
    
    .user-welcome {
        justify-content: center;
        font-size: 0.85rem;
        padding: 10px 14px;
    }

    /* Responsive para header */
    .header {
        margin-bottom: 32px;
    }
}

/* Estilos para mensajes del formulario */
.form-message {
    padding: 16px 20px;
    border-radius: 12px;
    margin: 20px 0;
    display: none;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    animation: slideInUp 0.3s ease-out;
}

.form-message i {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.form-message-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.form-message-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.form-message-loading {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.form-message-info {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estilos para archivo seleccionado */
.file-upload-area.file-selected {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    border-style: solid;
}

.file-upload-area.file-selected .file-upload-text {
    color: #10b981 !important;
}

.file-upload-area.drag-over {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.15);
    transform: scale(1.02);
}

/* Estilos para vista previa de imagen */
.preview-area {
    margin-top: 20px;
    text-align: center;
    display: none;
}

.preview-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Contenedor de botones de WhatsApp */
.whatsapp-buttons-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    display: flex;
    flex-direction: row;
    gap: 15px;
    animation: slideInRight 0.5s ease-out;
}

/* Botón flotante de WhatsApp base */
.whatsapp-float {
    display: flex;
    align-items: center;
    gap: 15px;
}

.whatsapp-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: none;
}

/* Botón de ventas/adquisición */
.sales-button {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
}

.sales-button:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 12px 35px rgba(255, 107, 53, 0.6);
}

.sales-button::after {
    border-color: #ff6b35;
}

/* Botón de soporte técnico */
.support-button {
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
}

.support-button:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 12px 35px rgba(37, 211, 102, 0.6);
}

.support-button::after {
    border-color: #25d366;
}

.whatsapp-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.whatsapp-button:hover::before {
    opacity: 1;
}

.whatsapp-button:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 12px 35px rgba(37, 211, 102, 0.6);
}

.whatsapp-button:active {
    transform: scale(1.05) translateY(0px);
}

.whatsapp-button i {
    font-size: 28px;
    color: white;
    z-index: 1;
    position: relative;
}

/* Tooltip del botón WhatsApp */
.whatsapp-tooltip {
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.whatsapp-float:hover .whatsapp-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.tooltip-arrow {
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid rgba(0, 0, 0, 0.9);
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

/* Animación de entrada */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animación de pulso para llamar la atención */
.whatsapp-button::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    border: 2px solid #25d366;
    opacity: 0;
    animation: whatsappPulse 2s infinite;
}

@keyframes whatsappPulse {
    0% {
        opacity: 0;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
    100% {
        opacity: 0;
        transform: scale(1.4);
    }
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .whatsapp-buttons-container {
        bottom: 20px;
        right: 20px;
        gap: 10px;
        flex-direction: row;
    }
    
    .whatsapp-float {
        flex-direction: column;
        align-items: center;
    }
    
    .whatsapp-button {
        width: 50px;
        height: 50px;
    }
    
    .whatsapp-button i {
        font-size: 20px;
    }
    
    .whatsapp-tooltip {
        margin-top: 8px;
        transform: translateY(-10px);
        font-size: 12px;
        padding: 8px 12px;
        white-space: nowrap;
    }
    
    .whatsapp-float:hover .whatsapp-tooltip {
        transform: translateY(0);
    }
    
    .tooltip-arrow {
        top: -6px;
        left: 50%;
        right: auto;
        bottom: auto;
        transform: translateX(-50%);
        border-left: 6px solid transparent;
        border-right: 6px solid transparent;
        border-bottom: 6px solid rgba(0, 0, 0, 0.9);
        border-top: none;
    }
}

/* Animaciones de entrada escalonadas */
.whatsapp-sales {
    animation: slideInRight 0.5s ease-out;
}

.whatsapp-support {
    animation: slideInRight 0.5s ease-out 0.2s both;
}

@media (max-width: 480px) {
    .features {
        grid-template-columns: 1fr;
    }
}
