/* Estilos específicos para la aplicación de facturas */

/* Estilos base */
body { 
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    background: #f4f4f4; 
    padding: 20px; 
    margin: 0; 
    color: #333;
    transition: background 0.3s;
}

.container { 
    max-width: 600px; 
    margin: auto; 
    background: white; 
    padding: 20px; 
    border-radius: 15px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); 
    width: 90%;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

h1 { 
    color: #2d3748; 
    margin-bottom: 20px; 
    font-size: 1.8rem;
    text-align: center;
    position: relative;
}

h1::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: #4299e1;
    margin: 10px auto 0;
    border-radius: 2px;
}

/* Selector de IA */
.ai-selector {
    display: flex;
    flex-direction: row;
    background-color: #f8f9fa;
    border-radius: 12px;
    padding: 0;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    width: 100%;
}

.ai-option {
    display: none;
}

.ai-label {
    flex: 1;
    text-align: center;
    padding: 15px 5px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-right: 1px solid rgba(0,0,0,0.05);
    color: #666;
    transition: all 0.3s ease;
    min-width: 0;
}

.ai-label:last-child {
    border-right: none;
}

.ai-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: 6px;
    border-radius: 50%;
    background-color: rgba(0,0,0,0.03);
    transition: all 0.3s ease;
    padding: 8px;
    box-sizing: border-box;
}

.ai-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0;
    max-width: 32px;
    max-height: 32px;
}

/* Ajuste específico para Gemini */
#gemini + .ai-label .ai-icon img {
    filter: brightness(1.05);
}

.ai-option:checked + .ai-label {
    background-color: white;
    color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ai-option:checked + .ai-label .ai-icon {
    transform: scale(1.05);
}

#gemini:checked + .ai-label .ai-icon {
    background-color: rgba(66, 133, 244, 0.1);
}

/* Botones de acción */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    margin-bottom: 15px;
}

.action-buttons button {
    flex: 1;
    padding: 12px 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.upload-btn {
    background-color: #4299e1;
    color: white;
}

.upload-btn:hover {
    background-color: #3182ce;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.upload-btn:active {
    transform: translateY(0);
}

.clear-btn {
    background-color: #f7fafc;
    color: #e53e3e;
    border: 1px solid #e2e8f0;
}

.clear-btn:hover {
    background-color: #fff5f5;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.clear-btn:active {
    transform: translateY(0);
}

/* Botón de procesar */
#processBtn {
    width: 100%;
    margin-top: 15px;
    background-color: #48bb78;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

#processBtn:hover {
    background-color: #38a169;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

#processBtn:active {
    transform: translateY(0);
}

#processBtn svg {
    margin-right: 8px;
}

/* Vista previa de imágenes */
#preview { 
    display: flex; 
    flex-wrap: wrap; 
    margin-top: 15px; 
    justify-content: center;
    gap: 10px;
    min-height: 50px;
}

.img-container {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    animation: imgFadeIn 0.3s ease-out;
}

@keyframes imgFadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.img-container:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

#preview img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover;
}

.delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background: rgba(220, 53, 69, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
}

.img-container:hover .delete-btn {
    opacity: 1;
}

.delete-btn:hover {
    transform: scale(1.15);
    background: rgba(220, 53, 69, 1);
}

/* Vista vacía */
.preview-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    height: 200px;
    background-color: #f8f9fa;
    border-radius: 12px;
    margin: 20px 0;
    border: 2px dashed #ddd;
}

.preview-placeholder svg {
    margin-bottom: 15px;
    opacity: 0.7;
}

.preview-placeholder p {
    color: #666;
    font-size: 16px;
    margin: 0;
}

/* Contador de imágenes */
#imageCounter {
    margin-top: 15px;
    font-weight: 500;
    color: #4a5568;
    text-align: center;
    transition: all 0.3s;
}

/* Información de optimización */
.optimization-info {
    background: #ebf8ff;
    border-left: 4px solid #4299e1;
    padding: 12px 15px;
    border-radius: 6px;
    margin-top: 20px;
    color: #2b6cb0;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
}

.optimization-info svg {
    margin-right: 10px;
    flex-shrink: 0;
}

.features-list {
    margin-top: 10px;
    padding-left: 20px;
}

.features-list li {
    margin-bottom: 5px;
    color: #4a5568;
}

/* Carga y animaciones */
#loading {
    display: none; 
    margin-top: 20px; 
    text-align: center;
}

.loader {
    border: 6px solid #f3f3f3;
    border-top: 6px solid #4299e1;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: auto;
}

#loading p {
    margin-top: 10px;
    color: #4a5568;
    animation: pulse 1.5s infinite;
}

#loading .loading-message {
    margin-top: 5px;
    font-size: 0.9rem;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Footer */
.main-footer {
    text-align: center;
    margin-top: 25px;
    color: #718096;
    font-size: 0.9rem;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.version {
    color: #a0aec0;
}

/* Ajustes responsivos */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 15px;
        width: 95%;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .ai-selector {
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: space-between;
    }
    
    .ai-label {
        padding: 12px 5px;
        font-size: 12px;
    }
    
    .ai-label span {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .ai-icon {
        width: 40px;
        height: 40px;
        margin-bottom: 4px;
        padding: 6px;
    }
    
    .ai-icon img {
        max-width: 28px;
        max-height: 28px;
    }
    
    .action-buttons {
        flex-direction: row;
        gap: 8px;
    }
    
    .action-buttons button {
        padding: 10px;
        font-size: 14px;
    }
    
    button svg {
        margin-right: 5px;
    }
    
    .img-container {
        width: 80px;
        height: 80px;
    }
    
    .optimization-info {
        padding: 10px;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .optimization-info svg {
        margin-bottom: 8px;
    }
    
    .features-list {
        margin-left: 15px;
    }
} 